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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Address Pattern
Expression
^[ \w\.]{3,}([A-Za-z]\.)?([ \w]*\##\d+)?(\r\n| )[ \w]{3,},\x20([A-Z]{2}\.)\x20\d{5}(-\d{4})?$
Description
The original pattern was: ^[ \w]{3,}([A-Za-z]\.)?([ \w]*\#\d+)?(\r\n| )[ \w]{3,},\x20[A-Za-z]{2}\x20\d{5}(-\d{4})?$ I changed the regular expression to allow a few different options. I like what you created here, but wanted to change the pattern to only allow for the capitol letters with an ending period after the state. I also thought it would be nice to allow the expression to show the possible option of direction with for example North, South, East or West with an ending period at the end of it. ^[ \w\.]{3,}([A-Za-z]\.)?([ \w]*\##\d+)?(\r\n| )[ \w]{3,},\x20([A-Z]{2}\.)\x20\d{5}(-\d{4})?$ Although the code was not altered much, it reflects the changes I find necessary for my needs.
Matches
123 Anywhere Dr. apt #99 Somewhere, ST 55789 | 123 Anywhere Dr. Somewhere, ST 55789 | 123 Anywhere D | 1234 W. Anywhere St. City, IN. 12345
Non-Matches
123 Anywhere Drive #99 Somewhere, ST 55789 - 1234 | 123 Anywhere Dr. apt. #99 Somewhere, ST 55789
Author Rating: Not yet rated. ljdwefdsyroqwj
   Displaying page 1 of 1 pages; Items 1 to 1

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