Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
([0-9]{4})(-)([A-Z]+)?(\s)?([A-Z]+)?(-)?(\s)?([A-Z]+)?(\s)?([A-Z]+)?
/
gm

Description

First Character Set: Any 4 numbers Second Character Set: <-> Third Character Set: Any amount of letters, optional Fourth Character Set: one white space, optional Fifth Character Set: Any amount of letters, optional Sixth: one white space, optional Seventh: you get the point…

Submitted by anonymous - 4 years ago