Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(?:^([A-Y])?\s*(\d{0,4})\s?([a-d])?)|(?:^((?:\w+)|(?:\w+,)|(?:\w+, \w*))?\s*((?:&{1,2}|and|or|\|{2})\s+(?:.*)*)*)
/
gm

Description

catches member no eg L 791a & separates mType and submember letter or catches name in last-name-first format or name plus a general search string lile 'and city is Bakersfield'

Submitted by anonymous - 4 years ago