Skip to main content

I'm not sure what words to use, again, to find my answer so I'm just going to ask.  I'm new to Regular Expressions, and not an FME wizard by any means

 

 

I need to, inside a loop,  take text that looks like this: (i'd like to avoid using blocking transformers if possible at this stage in my workbench)
OKC1D,790 l55559]|OKC1D, 791 Â272]|OKC1D, 792|OKC1D, 796|XD, 4-6 ,DEAD]

And make it look like this:


OKC1D,790 <5559]|OKC1D, 791 Â272]|OKC1D, 792  272]|OKC1D, 796 o272]|XD, 4-6 DDEAD]

 

With string replacers and searches I can get this:

OKC1D,790 <5559]|OKC1D, 791 g272]|OKC1D, 792|OKC1D, 796|

I'm able to select what's in the brackets with:

 

(?<=\>).*?(?=\])

 

but I get 5559 and 272,  I need a way to select the last matched group, 272, there are cases where it may be more than 2 match groups but I think that If I can just select the last one it should work

 

 

https://rubular.com/r/r2TsFBPPy19hFO

 

0684Q00000ArFUEQA3.png

 

 

Any regex wizards out there that may be able to help me, OR suggest a better way in FME to do what I want that will work inside a loop 

 

 

Thank you

Hi,

If you set a list name (e.g. "_all") to the All Matches List Name parameter in the StringSearcher, '272' would be stored into the second element ("_all{1}.match") in the list.


Reply