Title |
Test
Find
PO Box
|
Expression |
\b[P|p]*(OST|ost)*\.*\s*[O|o|0]*(ffice|FFICE)*\.*\s*[B|b][O|o|0][X|x]\b |
Description |
This expression will match almost all variations of PO Box. |
Matches |
P.O. Box, Po Box, Post Office Box, Box, P0 Box |
Non-Matches |
Controller's Office |
Author |
Rating:
Chris Myers
|
Source |
Self |
Your Rating |
|
Title: Don't match stree tnames
Name: Noah Sepsenwol
Date: 8/5/2011 9:30:40 AM
Comment:
So your expression doesn't match "Box Street" or " Box Elder Lane", I look for digits at the end of the expression:
\b[P|p]*(OST|ost)*\.*\s*[O|o|0]*(ffice|FFICE)*\.*\s*[B|b][O|o|0][X|x].*\d+\b
to match "PO Box 234", etc.
Title: Only the world box is necessary for a match....
Name: Sean Seymour
Date: 1/5/2008 9:30:23 PM
Comment:
for instance, matches this
my box
why not require a number at the end?
also, you're looking for 0 to infinity matches with those stars... {0,1} is a ?
I suggest modifying to this
\b([P|p](OST|ost)?\.?\s?[O|o|0](ffice|FFICE)?\.?\s)?([B|b][O|o|0][X|x])\s(\d+)