Regular Expressions 101

Community Patterns

1...45678...901

Community Library Entry

-2

Regular Expression
PCRE (PHP <7.3)

/
^((?<AddressType>\w+\s*)?(?<Unit>\d+\s*)\/)?(?<StreetNumber>(\s*(\d+\w+)+)|((\s*\d+\s*\-\s*\d+)))(?<StreetNameAndType>(?<StreetType>\s+\w+)+)\s*[,|.]?\s*(?<Suburb>[\w\s]+)\s+(?<PostCode>\d{4})$
/
mig

Description

A few Australian address parser

Submitted by Dennis Deljouei - 10 years ago