rollo67
December 12, 2022, 8:56am
1
EDIT:
to show the regex’ correctly.
Hi,
1st post in this forum.
I am trying to filter rows which contain a string starting with an asterisk:
column ‘name’
row 1: ‘*test_with_asterisk’
row 2: ‘test_without_asterisk’
Using rule based row filter, with expression
$name$ MATCHES /^\*/ => TRUE
Doesn’t work.
regex /\*/ doesn’t work either.
Am I doing something completely wrong or is it maybe a bug?
Thx, Rolf
ipazin
December 12, 2022, 9:09am
3
Hello @rollo67 ,
and welcome to KNIME Community!
In some nodes you’ll need multiple backslashes in order to escape special characters. See here for more . In your example to match asteriks this is expression:
$name$ MATCHES /\\*.*/ => TRUE
Besides standard nodes, for dealing with regex you might find Regex Extractor useful:
Palladian 2.0 for KNIME is here. Since we introduced Palladian into the KNIME ecosystem nine years ago, this is our first major update. It involved tweaking, fixing and improving existing nodes, replacing old nodes with updated ones and adding a new node on which we’d been working for a while and of which we’re particularly proud of: Say hello to Regex Extractor!
Regex Extractor
Fiddling with data inevitably brings you down to the hell of string voodoo and dark regex magic. If you’re like us a…
Br,
Ivan
6 Likes
Hi @rollo67
Welcome to the forum!
Just wanted to propose *.* in the normal Row Filter node, but happy you found a solution!
3 Likes
rollo67
December 12, 2022, 9:27am
5
Hi Ivan,
Thx for your quick reply, the double backslash made the trick!
And thx as well for the hint to the regex extractor.
Wonderful forum.
Rolf
2 Likes
system
Closed
December 19, 2022, 9:28am
6
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.