Regex validation for ZIP codes for each state -


i'm quite new regex , trying write regular expression matches zip codes in each state, having hard time. example, alaska has zip codes between 99501 , 99950, doesn't work:

99(5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9)(0|1|2|3|4|5|6|7|8|9) 

because matches 99951. done already, or mind helping me out @ least pattern this? here zip code ranges each state: http://www.structnet.com/instructions/zip_min_max_by_state.html

regexp poor choice problem think 1 might job done:

99(5(0[1-9]|[1-9]\d)|[6-8]\d\d|9([0-4]\d|50)) 

http://rubular.com/r/fs9btpggtt


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -