Filter out rows that has string with numbers in knime workflow

I am trying to filter rows with string $[‘data’][13] or $[‘data’][3] or $[‘data’][773].

  1. I have tried rule based row filter with expression $Column$ LIKE “$[‘data’][??]” => TRUE
    but this is only filtering data : $[‘data’][13] or $[‘data’][3] and not $[‘data’][773].
    The issue is we might have more data and numbers might increase to something like $[‘data’][773]. (3 digits) and right now data has only 2 digits ($[‘data’][13]), so $Column$ LIKE “$[‘data’][??]” => TRUE is working but $Column$ LIKE “$[‘data’][???]” is not working.

  2. I have also tried rule based row filter with expression $[‘data’][*]. but it is also including results like $[‘data’][0][‘total_time’] along with what I need.

Can anyone help me with this issue? TIA

What about using a Row Filter node with the following regular expression?

\$\['data']\[\d{1,3}]$

image

image

6 Likes

It worked!!
Thank you so much!
Can you help me understand this expression and what is use of \

Some of the symbols you’re searching for have specific meanings in RegEx, e.g. $ specifies the position at the end of a line.

The backslash is an escape character which restores the literal meaning of the character.

2 Likes

This is very helpful. Thanks agan!