Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
PCRE (PHP <7.3)

/
([^,]+),\s*(\d{4})\s*([^,]+)(?:,\s*([^,]+))?
/
u

Description

Street name XXX, XXXX City

XXX = House number XXXX = Zip code

Example:

Pompelpilten 72f, 2143 Ballehaug, Norway

Submitted by Yuppielabel - 9 years ago