regexMatcher in Column Expressions

Hi All,
I am finding the regexMatcher inconsistent or maybe I don’t understand how regex is implemented in Knime.
I have an expression, regexMatcher(column(“MyColumn”),“F[0-9]+”) but when I run the expression I get false for below

|12121112 F9731.|FALSE|
|12121211 2112|FALSE|
|111111111 F1111|FALSE|

I am assuming you expect a match on the first and last rows; the regex matcher works on the entire string so you’d need to have something like [^F]*F[0-9]+.*


Yes, sorry forgot to mention am after first and last row.
Thanks for the reply,
I’m finding something strange, feels like a knime bug:

0383487076 False 1
0111111 F1111 True 1
0111100 F7777 True 1
01111 F2281 True 1
01111111 F5334 True 1
01111111 False 1

Where false, it’s suppose to show 0 based on the column expression in the 3rd column:

if (regexMatcher(column(“Service_Number”),"[^F]F[0-9]."))

I only manage to get it to work correctly if I imply below in condition

if (regexMatcher(column(“Service_Number”),"[^F]F[0-9].")===“True”)

The regexMatcher function returns a String type - as it does in the String Manipulation node, for example; this is why you need do a comparison on the String representations of true and false.


make sense, thanks a lot

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.