Expression |
((\d{1,6}\-\d{1,6})|(\d{1,6}\\\d{1,6})|(\d{1,6})(\/)(\d{1,6})|(\w{1}\-?\d{1,6})|(\w{1}\s\d{1,6})|((P\.?O\.?\s)((BOX)|(Box))(\s\d{1,6}))|((([R]{2})|([H][C]))(\s\d{1,6}\s)((BOX)|(Box))(\s\d{1,6}))?)$ |
Description |
This is my first attempt at creating a regex. For a street number only field, allows 7 digit number, 6 digit number with one preceding letter (the letter can have a hyphen, space, or nothing between it and the numbers), two 7 digit numbers divided by a "/","\", or "-", variations of P.O. Box we allow, Rural Route, and Highway Contract acoording to U.S. Postal rules. |