Regex and 'add' function

Hello all,

I have a column with such values:
ABC46R|4658467|54989347AV
ASN4TY|3487456|5645RWUYN

How can I add word new only after first “|” ?
so, It should be like:
ABC46R|new4658467|54989347AV
ASN4TY|new3487456|5645RWUYN

I would like to do it in Regex (Cell spliter can be used here, but it is a long process).

Thank you for any help!

Best,
Ram

Hi,
Something like this in the string manipulation node should work:

regexReplace($column$, "^([^\\|]+\\|)(.*)", "$1new$2")

The first group catches the beginning, a sequence of characters that is not (^) the pipe symbol, followed by a pipe symbol. The second group catches the rest. Now in-between we add the “new”.
Kind regards,
Alexander

7 Likes

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