I am trying to remove part of string with regex but it seems not working. The strings are like that:
And I want to have only name e.g Julia_Roberts. I tried with:
which seems matching in different apps (e.g https://regex101.com/) but not with KNIME nodes. I tried with Regex Split, Substr(), String replacer, and String Manipulation but in vain.
Any suggestion ?
Hi there @mateenraj,
how about this one?
Works both in Regex Split and String Replacer.
Or this function in String Manipulation?
substr($column1$, 0, indexOf ($column1$, "(" ) - 1)
This is under assumption second row of your example misses underscore after name
Thanks for your quick reply, it partially solved the problem.
I missed to mentioned that there are rows which are without additional strings at the end and I want to keep them as they are (no change). Please find attached workflow.
MateenRegEx_Problem.knwf (17.2 KB)
You are missing backreference ($1) in String Replacer. Add it under Replacement text option
Also this one for Regex Split should work:
but as you are not splitting anything I wouldn’t use it and you still have to remove additional column.
String Manipulation with substr() function won’t work obviously
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.