Solved

Regular Expressions

Posted on 2004-09-27
2
167 Views
Last Modified: 2013-12-24
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
0
Comment
Question by:CFDevHead
2 Comments
 
LVL 5

Expert Comment

by:smaglio81
ID: 12161149
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
0
 
LVL 15

Accepted Solution

by:
danrosenthal earned 500 total points
ID: 12163823
<CFSET idnumber = "000000000">

<CFIF REFIND("^[0]+$",idnumber)>
  All Zeroes!!<CFABORT>
</cfif>

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now