-----Original Message-----
From: Jerry Johnson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 23, 2004 11:27 AM
To: CF-Talk
Subject: Re: Quick Regular _expression_ Question.
<cfif NOT REFind('^[[:digit:]]{5}(( |-)?[[:digit:]]{4})?$',
#FORM.BillZip#)>
Lets see if I can break this down, and maybe the answer will fall out the
other side.
string containing only:
5 digits
and
0 or 1 sets of ((0 or 1 dash or space) and four digits)
So, if you got rid of the 0 or 1 dash or space, and made it a manditory
space in the second optional set, you should be good.
<cfif NOT REFind('^[[:digit:]]{5}(-[[:digit:]]{4})?$', #FORM.BillZip#)>
(Maybe)
Jerry Johnson
>>> [EMAIL PROTECTED] 06/23/04 11:16AM >>>
Hello all. I use the following to regular _expression_ to validate zipcodes.
<cfif NOT REFind('^[[:digit:]]{5}(( |-)?[[:digit:]]{4})?$',
#FORM.BillZip#)>
<cfset CreateAccountFlag = "Yes">
<cfset BillZipInvalidFlag = "Yes">
</cfif>
When a customer inputs a 9 digit zip code WITHOUT the hyphen, no error is
set. (i.e. 902101444)
How would I modify this to incorporate a mandatory hyphen when a 9 digit
zip
code is inputed and still work for all other zip codes?
TIA...Che
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

