Skip to main content
Question

Look behind regex in StringSearcher


Forum|alt.badge.img
I'm trying to use the following regular expression in StringSearcher (?<=Switch Description ).{5} So for example applied to the following text "Switch Description 1757A" it would find "1757A" However, im getting the following message "couldn't compile regular expression pattern: quantifier operand invalid" Anyone know why this is?

4 replies

takashi
Evangelist
  • November 10, 2015
Hi,

 

 

Some modules of FME including the StringSearcher use Tcl to perform regex operations internally, and Tcl regex engine seems to be one which doesn't support lookbehind unfortunately. See also here.

 

 

Takashi

Forum|alt.badge.img
Thanks Takashi. I guess i'll have to find the whole string then split it.

takashi
Evangelist
  • November 10, 2015
Yup, if you need to split a text starting with "Switch Description" into the description text and the last 5 characters, this regex would work for the StringSearcher, for example.

 

(Switch Description)\s*(.{5})

fmelizard
Safer
Forum|alt.badge.img+19
  • Safer
  • November 13, 2015
I can also advise that in FME 2016, all regular expression evaluation is now unified under a new, modern, non-Tcl engine.

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