Thanks to everyone. I managed to come up with one similar to Byron's example
and then tweaked it further (No spaces) so I could use it in JS on the
client and CF on the server. I knew I could do it in 2 or three steps but
wanted one step so I could hand off the regex to the client for
I am terrible at Regex's. I looked all over and am going blind. Is there
anyone here that can shorted my search? I need one to test true for:
10 to 20 Characters in length
3 numeric characters in any order
1 special character from basic list ~!@#$%^*()_+
Any help is appreciated.
Dennis
Can't really help you with the regex, but regexlib.com might help you with
future ones. I use it whenever I need a regular expressions
-Original Message-
From: UXB [mailto:denn...@uxbinternet.com]
Sent: Monday, July 21, 2014 6:30 PM
To: cf-talk
Subject: Regex help maybe
I am terrible
X{10,20} means that X should exist at least 10 times but no more than 20
times
[0-9] means any single number from 0 till 9
[0-9]{3} means any 3 numbers of 0-9 one after the other
[~!@#$%^*()_+] means a single character from the set of characters defined
between the brackets
Now do you want 3
I need one to test true for:
I doubt you can do this with only one test, but using 3 tests is easy:
10 to 20 Characters in length
3 numeric characters in any order
1 special character from basic list ~!@#$%^*()_+
This should do it:
CFSET stringOK = (len(form.text) GTE 20 AND len(form.text)
This would do one special, 3 consecutive numbers: ajfds123jdfs#
^(?=.*\d{3})(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+).{10,20}$
This would do one special, 3 numbers any position: a#bcdef2k3#4^
^(?=.*\d.*\d.*\d)(?=.*[\~\!\@\#\$\%\^\\*\(\)\_\+]+).{10,20}$
And if your restricting to just numbers and the
6 matches
Mail list logo