Skip to main content
Solved

ReplaceRegularExpression syntax

  • May 9, 2022
  • 2 replies
  • 981 views

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 \\".

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • Best Answer
  • May 9, 2022

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
  • 5 replies
  • May 9, 2022

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.....