RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find parts of an address
Expression
^ (?<FullStreet> (?<Detail>(?:C/[-O]?[a-z\ ]*?)?\ *)? (?<POBox>P[\.\ ]?O[\.\ ]?\ ?Box\ *\d+) | (?:(?<Detail>(?:C/[-O]?)?[\w\ ,\.']+?),?/?\ *?)? \ *?\b(?<StreetNum>(?:\d+-)?\d+[a-z]?)[\ ] (?<StreetFullName> (?<StreetName>(?:[\w\ '-]|st)+) (?:\b(?<StreetType>ALLEY|ALLY|APPROACH|APP|ARCADE|ARC|AVENUE|AVE|BOULEVARD|BLVD|BROW|BYPASS|BYPA|CAUSEWAY|CWAY|CIRCUIT|CCT|CIRCUS|CIRC|CLOSE|CL|COPSE|CPSE|CORNER|CNR|COVE|COURT|CRT|CT|CRESCENT|CRES|DRIVE|DR|END|ESPLANANDE|ESP|FLAT|FREEWAY|FWAY|FRONTAGE|FRNT|GARDENS|GDNS|GLADE|GLD|GLEN|GREEN|GRN|GROVE|GR|HEIGHTS|HTS|HIGHWAY|HWY|LANE|LINK|LOOP|MALL|MEWS|PACKET|PCKT|PARADE|PDE|PARK|PARKWAY|PKWY|PLACE|PL|PROMENADE|PROM|RESERVE|RES|RIDGE|RDGE|RISE|ROAD|RD|ROW|SQUARE|SQ|STREET|ST|STRIP|STRP|TARN|TERRACE|TCE|THOROUGHFARE|TFRE|TRACK|TRAC|TRUNKWAY|TWAY|VIEW|VISTA|VSTA|WALK|WAY|WALKWAY|WWAY|YARD )\b) ) ) (?:,?\ *?(?<Town>[a-z'.]+(?:,?\ +[a-z'.]+)*?))? (?:,?\ *?(?<State>Victoria|VIC|New South Wales|NSW|South Australia|SA|Northern Territory|NT|West Australia|WA|Tasmania|TAS|Australian Capital Territory|ACT|Queensland|QLD))? (?:,?\ *?(?<PostalCode>\d{3,4}))? (?:,?\ *?(?<Country>Au(?:stralia)?))? (?:(?=[^$])\s)* $
Description
Divides a single line address into detail, street number, street name , street type, town, postcode, state, country. designed for Australian addresses but can be modified. switches: ignore expression whitespace, case insensitive. teseted using silverlight tester from regexlib. based on regex by Zijian http://regexlib.com/REDetails.aspx?regexp_id=1964
Matches
Shop S1, Sussex Centre, 401 Sussex St, Sydney; 28 Lidco Street, Arndell Park, Sydney 2148; Level 1, 198 Elizabeth St, Surry Hills 2010; Room 2, Level 1, 198 Elizabeth St, Surry Hills, NSW 2010; 541 Pittwater Rd, Brookvale 2100; 2 Maniangi Court, Macedon, 3440; PO Box 1531, Keveland, QLD 4163; St Lucia Golf Links, 22 St George St, St Lucia, QLD; PO Box 1531, St Lucia, QLD 4163;
Non-Matches
M/S 1014 Bell 4408; Kingswood Hostel Ramsay Street Toowoomba 4350; 15osborne Court Logan Holme 4129; Miamba Condamine 4416; Crows Nest Nursing Home Crows Nest 4352; 30 Skyline Drive M/S 617 Toowoomba Mail 4352; M/S 1945 Peranga 4352; 22a Wirra Wirra Toowoomba 4350; C/- Blue Care, Stenner Street Toowoomba 4350; Carline' M/S 848 Warwick 4370; 336 Oakey-Biddeston Rd, Ms 212 Oakey 4401; Kingswood Hostel Ramsay Toowoomba 4350; Shalom N/H - Rosalie & Lockyer Toowoomba 4350; Unit 2 Glenfield Grange,110 Spring Stree Toowoomba 4350; Villa 65 Westhaven Retirement Village Toowoomba 4350; Y
Author Rating: The rating for this expression. v
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Copyright © 2001-2018, RegexAdvice.com | ASP.NET Tutorials