Help

Re: Regex replace

Solved
Jump to Solution
1712 0
cancel
Showing results for 
Search instead for 
Did you mean: 
kennypurnomo
7 - App Architect
7 - App Architect

Hi, i have a formula field named "Jenis Parts Regex" where its value is "15.9mm Karet stabil FR RH/LH ES1|05".

I want to extract anything that matches "end_of_name" field, in this case "ES1|05", and the result shall be in "regex replace" field.

But what i got there is "15.9mm Karet stabil FR RH/LH |". Why am i getting "|" ?

Here is my formula in "regex replace" field:

REGEX_REPLACE({Jenis Parts Regex},end_of_name,"")

Please help
Thanks
kennypurnomo_0-1689147356613.pngkennypurnomo_1-1689147370086.png

 

1 Solution

Accepted Solutions
Sho
11 - Venus
11 - Venus

Hi @kennypurnomo ,

In regex, "|" means OR.
So "ES" or "05" is replaced and "|" remains.
If "|" in end_of_name is escaped to "\|", it is treated as a string and can be replaced.

See Solution in Thread

4 Replies 4
Sho
11 - Venus
11 - Venus

Hi @kennypurnomo ,

In regex, "|" means OR.
So "ES" or "05" is replaced and "|" remains.
If "|" in end_of_name is escaped to "\|", it is treated as a string and can be replaced.

kennypurnomo
7 - App Architect
7 - App Architect

thanks!

kennypurnomo
7 - App Architect
7 - App Architect

How do i proceed with this? i tried to 


REGEX_REPLACE(end_of_name,"|","\|")

But the result is this
\|D\|D\|1\||\|1\|4\|
Sho
11 - Venus
11 - Venus
In your example, it would be like this.

 

REGEX_REPLACE("15.9mm Karet stabil FR RH/LH ES1|05","ES1\|05","")