I have follow-up question on a similar line…
Python or Regexer identifies “[0-9]+.[0-9]{2}” as the right Regex identifier for finding values like “180.34” but KNIME also identifies below as the ‘True’. I cannot figure out the reason as it is a very simple REGEX.
A regexMatcher function is boolean based. So it returns true or false depending on if a match was found for the column you selected. The regex that you have however has a meta escape in it so it’s basically matching everything that has at least 4 numbers in it.
Change it to [0-9]+[.][0-9]{2} if you only want to capture the format with a period.
Hi @Jyotendra , just adding to @ArjenEx’s explanation, you need to remember that the “.” in regex means “any single character” unless it is escaped or, as in the explanation already given entered in square brackets.
So your regex “[0-9]+.[0-9]{2}” can be read as:
“match a sequence of 1 or more digits followed by any character followed by 2 digits”.
And if you read it that way you can see that all of your examples match as follows (I have spaced out to highlight possible components parts which allow the match to be true): 225 . 00 21 : 46 315921851 3 08 9 2 11
the regex [0-9]+\.[0-9]{2} would also work (although as noted earlier, when entered in nodes such as string manipulation, it would have to be “double escaped” as "[0-9]+\\.[0-9]{2}"