Solved

Regular Expressions

Posted on 2004-09-27
2
166 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

743 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