Skip to main content
Nintex Community Menu Bar
Solved

How to replace a "pipe" in a regular expression ?

  • February 2, 2016
  • 6 replies
  • 868 views

Forum|alt.badge.img+6

Hello,

 

As you can see in the screen, I used a regular expression to replace an expression like : i:0#.w|blablabla to blablabla

But when I execute my action the expression is : |blablabla

 

Problem :

When I used regular expression, this part "i:0#.w" is delete so it's OK but I don't know why the pipe "|" stay.

I try ASCII into the regular expression but it not work &#124

 

 

Do you have solution to fix it ?

Best answer by francois

Absolutely

Add backslash before the pipe to have the correct result.

remove_pipe.png

6 replies

Forum|alt.badge.img+11
  • Rookie
  • February 2, 2016

Hi Theo,

A pipe "|" expression in regex tells the system that a match can be on either side of the |. To replace this character you may have to escape it.

I'm not a pro at regex but this is what i have seen in the past. See more details here: replacing pipe "|"


Forum|alt.badge.img+6
  • Answer
  • February 2, 2016

Absolutely

Add backslash before the pipe to have the correct result.

remove_pipe.png


Forum|alt.badge.img+6
  • Author
  • February 3, 2016

Thanks, I'm going to try and get back to you =)


Forum|alt.badge.img+6
  • Author
  • February 3, 2016

Thanks for your help ! It works well =)

KR

Theo


Forum|alt.badge.img+6
  • Author
  • February 10, 2016

Yes, sorry I forgot


Forum|alt.badge.img+4

Thank you very much.  I am now trying to do the same with a form variable in New Responsive and I cannot get this to work.  When I use 

  • Start is: i:0#.x|member|i999999@test.com
  • Variable setup is:  replace(FORM.FieldName),"i:0#.x|member|","")
  • Result is:  ||i999999@test.com

 

Do you @francois  know how to remove the pipe in this case? When I try to use a backslash it disallows this in the variable setup.