Clovertech
› Clovertech Forums › Read Only Archives › Cloverleaf › General › more egrep help
i need a regex to return all the matches for the following:
“PM|04665|||20091103004500||ADT^A23|”
“PM|04665|||20091103004533||ADT^A29|”
“PM|04665|||20091123012323||ADT^A34|”
Any help is appreciated.
Try this:
egrep ‘PM|04665|||[0-9]{14,14}||ADT^A(23|29|34)|’
-- Max Drown (Infor)
thanks worked like a charm
If I may make a suggestion that may or may not make your life easier: instead of writing long, complicated regexp, try stringing some pipes together like this …
egrep ‘04665’ | egrep ‘ADT’ [code]egrep ‘04665’ | egrep ‘ADT’
egrep ‘04665’ | egrep ‘ADT’