US addresses are not a regular language, and cannot be matched by using regular expressions. They are helpful in some isolated cases, but in general, they will fail you, especially for input like that.

I used to work at an address verification company. In answer to your question, to "highlight an address" in a string of text, I recommend you try an extraction utility. There are a few out there and I suggest you look around, but here is ours using the input from your question --- as you can see, it found the address and validated it:

LiveAddress extraction example

The API endpoint returns JSON which contains the start and end positions of each address, as well as plenty of information about each one. (See the CSV output at the bottom of the picture above.)

I commend you for braving those regular expressions you tried! Hopefully this is helpful.


Matt is right. Regex parsing is never going to be very accurate. You'll inevitably have a reasonable number of false positives and false negatives if you go down this dangerous road. However, if you're okay with that, I actually like to use a combination of two regexes - one for street named based schemes and one for city grid schemes:

Street Name System:

/\b\d{1,6} +.{2,25}\b(avenue|ave|court|ct|street|st|drive|dr|lane|ln|road|rd|blvd|plaza|parkway|pkwy)[.,]?(.{0,25} +\b\d{5}\b)?/ig

Grid System

/(\b( +)?\d{1,6} +(north|east|south|west|n|e|s|w)[,.]?){2}(.{0,25} +\b\d{5}\b)?\b/ig

Also note that if the address doesn't have a state and zipcode, you can basically forget about extracting any text that goes after the street moniker.