/^\d+\t(\d{5})\s*\n$/&&...
The reason being that your code will pass 072300 as a valid zip code when it's obviously not.
Now - I just thought of this: Only Zip5 will be allowed. Zip5+4 is not possible? If it is, change that regex to:
/^\d+\t(\d{5})(-\d{4})?\s*\n$/&&...
------ We are the carpenters and bricklayers of the Information Age. Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement. Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified. |