Skip to main content
Question

Error regular expression

  • July 13, 2018
  • 7 replies
  • 18 views

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

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

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.

7 replies

takashi
Celebrity
  • 7843 replies
  • 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
  • 13 replies
  • July 13, 2018

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

FME 2017.1

 

 


takashi
Celebrity
  • 7843 replies
  • July 13, 2018

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
  • 13 replies
  • July 13, 2018
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
  • 8394 replies
  • 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
  • 8394 replies
  • July 13, 2018

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
  • 13 replies
  • July 13, 2018

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

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