Skip to main content
Question

Error regular expression


maica
Contributor
Forum|alt.badge.img+1
  • Contributor

I have a string such as: 3R3002 - Oneri finanziari su derivati - COLLAR I use the SrtingSearcher tranformer to find all after the first dash (Oneri finanziari su derivati - COLLAR) with the regular expression: -[\\s\\S]*$ but I receive an error: couldn't compile regular expression pattern: invalid escape \\ sequence

7 replies

takashi
Influencer
  • July 13, 2018

I was not able to reproduce the error with FME 2018.0. What version of FME are you using?


maica
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • July 13, 2018
takashi wrote:

I was not able to reproduce the error with FME 2018.0. What version of FME are you using?

FME 2017.1

 

 


takashi
Influencer
  • July 13, 2018
takashi wrote:

I was not able to reproduce the error with FME 2018.0. What version of FME are you using?

It worked even with FME 2017.1.2.1 in my environment.

 

-[\s\S]*$

0684Q00000ArMZMQA3.png

 


maica
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • July 13, 2018
takashi wrote:
It worked even with FME 2017.1.2.1 in my environment.

 

-[\s\S]*$

0684Q00000ArMZMQA3.png

 

Maybe with FME 2017.1.0.0 not work. I don't know why. Thanks for your help

david_r
Celebrity
  • July 13, 2018

You can also try this regex (using a positive look-behind), the result will be output as _first_match:

(?<= - ).*

david_r
Celebrity
  • July 13, 2018
david_r wrote:

You can also try this regex (using a positive look-behind), the result will be output as _first_match:

(?<= - ).*
Tested with both FME 2018 and 2016.1

maica
Contributor
Forum|alt.badge.img+1
  • Author
  • Contributor
  • July 13, 2018
david_r wrote:

You can also try this regex (using a positive look-behind), the result will be output as _first_match:

(?<= - ).*
Thanks!! This work well.

 

 


Reply


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