RegexHub
RegexHub copied to clipboard
Added an Address-Parsing Regex
Regex which parses a multi-line address into its component parts. Address can be formatted as a single line with commas, or multiple lines. This can probably be made better by someone smarter than myself as it is currently not foolproof. At a minimum, the Street, City, and State must exist, otherwise nothing will match or the match will be incorrect.
The matches are as follows
- Match 1: Street address.
- Match 2: Apt/Suite/Unit #
- Match 3: City.
- Match 4: State.
- Match 5: Postal Code.
- Match 6: Country
Examples of addresses which match:
123 Easy Way Somecity, AK
123 Easy Way Unit 1 Somecity, AK 12345 USA
123 Easy Way, Somecity, AK
123 Easy Way, Unit 1, Somecity, AK 12345 USA