I'm quite new to regex and trying to write a regular expression that matches the ZIP codes in each state, but having a hard time. As an example, Alaska has ZIP codes between 99501 and 99950, but this 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 it also matches 99951. Anyone done this already, or mind helping me out with at least the pattern for this? Here are the ZIP code ranges for each state: http://www.structnet.com/instructions/zip_min_max_by_state.html