Remove the symbols from the end of a column string until the string ends with a number(0 to 9) or a letter (a to z)

Hi,

I have to remove the symbols like
±/%# etc from the end of a string until that strings ends with numbers 0 to 9 or any letters from a to z.

Example:
image

Thanks
Soumya

Hi @soumya123 . Welcome to the KNIME community.

This can be achieved with the String Replacer node, using the regular expression as follows:

Pattern:
(.*[0-9A-Za-z]).*

Replacement Text:
$1

This “captures” everything up to and including the final letter or digit, and discards the rest

forum - Remove after last digit or letter.knwf (9.3 KB)

3 Likes

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