String Manipulation RegEx Replace Not Working?

Hello all,

I would like to find the pattern \(\d,\d,\d\) and replace it with "".

Example of string:

C(3,0,1)-2(1)-C(2,0,1)=2 C(3,0,1)-2(1)-C(3,0,1)=1 C(3,0,2)-2(1)-C(3,0,1)=-2 C(3,0,2)-2(1)-C(3,0,2)=-1 O(1,0,0)-2(1)-C(3,0,1)=1 O(2,0,1)-2(1)-C(3,0,2)=-2

I am using String Manipulation to do it with a code like this:

regexReplace($Reaction Vector AP2$,"\(\d,\d,\d\)","") in which $Reaction Vector AP2$ is the name of my target column.

The node looks like not working at all.

Can you help me?

Thanks,

Giammy

Hey Giammy,

since Java handles "\" as an escape character, you have to escape it with another "\", so Java can read it properly.

regexReplace($Reaction Vector AP2$,"\\(\\d,\\d,\\d\\)","") works fine.

Have a nice day,

Julian

 

 

2 Likes