Skip to main content
Solved

ReplaceRegularExpression syntax


Hi, I am trying to use ReplaceRegularExpression as described here:

http://docs.safe.com/fme/html/FME_Desktop_Documentation/FME_Transformers/!Transformer_Parameters/StringFunctions.htm

To do a simple transformation of Quotes to escaped Quotes in strings.

 

I have the following:

@ReplaceRegularExpression(@Value(Description),["],"\\\\""",FALSE)

(as the instructions say I need to add quotes and escape the quote in the to expression.)

This does not work, but at least does not have errors.

If I try to slightly change the syntax of the to expression (eg less quotes) I get serious errors...

 

Any ideas welcome...

 

 

 

 

Best answer by nielsgerrits

I tried a bit and

@ReplaceRegularExpression(@Value(Description),\",\\",caseSensitive=TRUE)

seems to work for me. As an alternative you can also use the StringReplacer set to Regular Expression replacing " with \\".

View original
Did this help you find an answer to your question?

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+54

I tried a bit and

@ReplaceRegularExpression(@Value(Description),\",\\",caseSensitive=TRUE)

seems to work for me. As an alternative you can also use the StringReplacer set to Regular Expression replacing " with \\".


  • Author
  • May 9, 2022
nielsgerrits wrote:

I tried a bit and

@ReplaceRegularExpression(@Value(Description),\",\\",caseSensitive=TRUE)

seems to work for me. As an alternative you can also use the StringReplacer set to Regular Expression replacing " with \\".

Many thanks...that seems to work fine now.....


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings