>bOK = Refind("[A-Z]",pass) AND ReFind("[a-z]",pass) AND
ReFind("[0-9]",pass)


This will check that the password contains at least one letter of each case
and a digit, but it won't make sure the password contains no other symbols.
I'm assuming the password is supposed to consist ONLY of mixed case letters
and digits. If that's not the case, then the code above is sufficient.

Otherwise, something like the following will check nothing else is in the
password:

    <cfset temp = trim(form.password)>
    <cfset temp=REReplace(temp, "[[:digit:]]", "" ,"ALL")>
    <cfset temp=REReplace(temp, "[[:upper:]]", "" ,"ALL")>
    <cfset temp=REReplace(temp, "[[:lower:]]", "" ,"ALL")>

 <cfif temp neq "">
         something bad is in the password
  <cfif>

There's probably a regex way to condense all that into one line.


At 01:37 PM 5/13/02 +0200, you wrote:
>bOK = Refind("[A-Z]",pass) AND ReFind("[a-z]",pass) AND
>ReFind("[0-9]",pass)
>
>-----Original Message-----
>From: Zac Spitzer [mailto:[EMAIL PROTECTED]]
>Sent: maandag 13 mei 2002 13:13
>To: CF-Talk
>Subject: Re: check for mixed case plus a numeric
>
>
>Brian Scandale wrote:
>
>>Trying to check for mixed case, and at least one digit in a prospective
>
>>password.
>>
>>Any ... snippets that might help me get started??
>>
>>Thanks,
>>Brian
>>
>>




FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to