Skip to main content

Hello all,

I'm using a basic regex to take the lines contains 'TWY' string in StringSearcher Transformer.

The expression returns the expected result when I trying in https://regex101.com/r/mT5rZ3/56here . However, when I try this in the transformer it returns only 1 match.

What am I suppose to do to get every line containing TWY on different match index

I think this expression is difficult as I think by default in fme the dot matches a newline character and the expressions are greedy.

Depending on what your final goal is I'd look at going about this in the other way, e.g. splitting the attribute on the linefeed then testing for the TWY


Hopefully this regex matches each line containing "TWY".

>^\r\n]*?\bTWY\b.*?$

@egomm as you said I guess the dot matches a newline character as well or it has single line flag.

It would be nice to see a documentation of this. Which flags and engine (PRCE probably) does FME using? And is it possible to change the flags?

@takashi that regex worked like a charm!

Thank you both.

 

 


Reply