Jarrod13
Programmer
- Dec 18, 2008
- 12
I'm trying to modify this regular expression so that a zip code with a space directly after it will pass. That is, if I have a zip code "45887 " It will not be added to the "BadZipCount array"
I've highlighted in blue what I have now. It will check for a space before and after the zip code and if there is one the "BadZipCount array" will be incremented.
Thank you
I've highlighted in blue what I have now. It will check for a space before and after the zip code and if there is one the "BadZipCount array" will be incremented.
Code:
if(ZIPCODE !~ "^[0-9][0-9][0-9][0-9][0-9]$" && ZIPCODE !~ "^([0-9][0-9][0-9][0-9][0-9])(-)([0-9][0-9][0-9][0-9])$" && ZIPCODE != "" && [COLOR=blue]ZIPCODE !~ "^[ \t]*$[/color]")
{
BadZipCount[x]++;
BadZipCounter++;
BadZipArray[BadZipCounter]=ZIPCODE;
ZipColumn[ZIPFIELDS[x]] = (BadZipCount[x] "," ZIPFIELDS[x]);
}
Thank you