Icon

kn_​example_​regex_​match_​words

RegEx match complete word with special characters - using Rule Engine, Column Expressions, String Manipulation, and Java Snippets
RegEx match complete word with special characters - using Rule Engine, Column Expressions, String Manipulation, and Java Snippetshttps://forum.knime.com/t/row-filter-based-in-a-group-of-words/48551/6?u=mlauber71 Test RegEx patterns and have them explainedhttps://regexr.com/https://regex101.com/ try to match"S.A.S."$my_text$ MATCHES /^.*(S\\.A\\.S\\.).*$/ =>"contains S.A.S."if (isMissing(column("my_text")) ) {false}else if (regexMatcher(column("my_text"), "^.*(S\.A\.S\.).*$")) {true}else {false} regexMatcher($my_text$, "^.*(S\.A\.S\.).*$")Pattern p = Pattern.compile("(^.*)(S\.A\.S\.)(.*$)");Matcher m = p.matcher($my_text$);// catch a possible missing valueif ($my_text$ == null) {return "";}// return the second matching groupelse if (m.find()) { return m.group(2);}else {return "";}Pattern p = Pattern.compile("^.*(S\\.A\\.S\\.).*$");Matcher m = p.matcher(c_my_text); Table Creator Rule Engine Column Expressions String Manipulation Java Snippet(simple) Java Snippet RegEx match complete word with special characters - using Rule Engine, Column Expressions, String Manipulation, and Java Snippetshttps://forum.knime.com/t/row-filter-based-in-a-group-of-words/48551/6?u=mlauber71 Test RegEx patterns and have them explainedhttps://regexr.com/https://regex101.com/ try to match"S.A.S."$my_text$ MATCHES /^.*(S\\.A\\.S\\.).*$/ =>"contains S.A.S."if (isMissing(column("my_text")) ) {false}else if (regexMatcher(column("my_text"), "^.*(S\.A\.S\.).*$")) {true}else {false} regexMatcher($my_text$, "^.*(S\.A\.S\.).*$")Pattern p = Pattern.compile("(^.*)(S\.A\.S\.)(.*$)");Matcher m = p.matcher($my_text$);// catch a possible missing valueif ($my_text$ == null) {return "";}// return the second matching groupelse if (m.find()) { return m.group(2);}else {return "";}Pattern p = Pattern.compile("^.*(S\\.A\\.S\\.).*$");Matcher m = p.matcher(c_my_text); Table Creator Rule Engine Column Expressions String Manipulation Java Snippet(simple) Java Snippet

Nodes

Extensions

Links