Skip to main content

Hello ,

i would like to use Regex to find three cases :

1.the string that starts with one letter then numbers as example a73939 or s939

2.and also to find string like S2820_hjd

(one letter then few numbers then underscore then numbers or letters )

3.and any string that start with one letter then underscore as O_Sjdld

i tried using string searcher transformer but I am not sure which regex should I type ?

fme 2021

thanks for help

 

So a string starting with a letter followed by one or more numbers

^

^ start of line

oa-zA-Z] matches a single character

e0-9] matches a single number

.* matches any character an unlimited number of times

 

A string that starts with one letter then an underscore

^ta-zA-Z]_.*

^ start of line

_a-zA-Z] matches a single character

_ matches an underscore

.* matches any character an unlimited number of times

 

You can put them together separated by a pipe in the StringSearcher so anything that matches one or the other will exit the Matched port

e.g.

^ca-zA-Z]e0-9]{2}.*|^oa-zA-Z]_.*

 

 

 


Reply