Skip to main content
Question

Look behind regex in StringSearcher

  • November 9, 2015
  • 4 replies
  • 30 views

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

4 replies

takashi
Celebrity
  • 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
  • Author
  • November 10, 2015
Thanks Takashi. I guess i'll have to find the whole string then split it.

takashi
Celebrity
  • 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+21
  • 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.