Link to home
Start Free TrialLog in
Avatar of CFDevHead
CFDevHead

asked on

Regular Expressions

I am trying to stop users from entering an id number (which has to be between 1 and 11 chars in length) that is all zeros like so "000" or "0000000000" but they can enter in BLL00ssa
I started with this
<cfif not findNoCase('[1-9]+[a-z]+[A-Z]',id)>
      <script language="JavaScript">
        self.opener.zeros();
      </script>
      <script language="JavaScript">
            self.close ();
            window.close ();
      </script>


</cfif>
but as U can see it does not work
Avatar of smaglio81
smaglio81

It might be a typo but you are using findNoCase, since you are looking to use Regular Expressions, you might want to try using REFindNoCase().

I would probably be best to review the CFML Reference page for REFindNoCase (http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/functa64.htm#wp1111121).

If the regular expressions become to cumbersome, you might want to just hard code in the 11 <cfif> statements that would check for the taboo strings.

Best of luck,

Steven
ASKER CERTIFIED SOLUTION
Avatar of danrosenthal
danrosenthal

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial