Regular Expression Engine

Hey All!

I can get regular expressions to work in KNIME most of the time but I have a big issue I am trying to solve. For whatever KNIME will not capture the ‘@’ in the RexEx matcher.

I type something like this [A-Za-z0-9]+@ and it can’t find the @. What am I doing wrong?

Also, what engine is KNIME using for regular expression syntax?

Hi,

Would you please provide an example of the string you want to match with this regex pattern?

:blush:

Hi @armingrudd,

I would like some degree of email matching to a part of a larger expression for a project and it seems that Regex Matcher won’t match special characters.

edit: I would also like to be able to match on @$%& etc. But can’t get KNIME to match on any of those.

abc123@.com
aaabbbccc@.org

Of course it does. You have to match the whole string not just a part of it.
For example to match emails like “abc123@abc123.com”, you have to use this regex:

regexMatcher($column1$, "[A-Za-z0-9]+@[A-Za-z0-9]+\\.[a-zA-Z]{2,3}")

:blush:

@armingrudd,

Thank you, that makes sense. I guess I was hoping I could write the expression slightly differently by just having a group followed by a special character. I’m not even concerned about the .com part

What do you mean by differently?
There are so many patterns you can use to match this format.
Let me know what you were trying to do and I will help you with that.

:blush:

Thank you! I just want to find A-Za-z0-9 followed by an @ sign or $ or &.etc.

Then use this:
regexMatcher($column1$, "[A-Za-z0-9]+[@$&!#%]")

This will match any string starting with some text and numbers followed by one of the special characters I have added.

If it can be followed by anything after the special character, then add the .* after the last brackets.

Is that clear?

:blush:

2 Likes

@armingrudd,

Got it! Thank you!

1 Like

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