Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE (PHP <7.3)

/
^[A-Z]{1,2}|[a-z]{1,2}
/

Description

Strips out the postcode area (first one or two letters e.g. [WA]1) from a UK postcode.

Submitted by Martin E - 8 years ago