What if it doesn't come from a browser? impoted from a file or cfhttp etc... javascript isn't going to help him there. that's a big assumption...
Code:
<cfset x = "ab55133billybob788">
<cfif reFind("^[A-Za-z]{2}[0-9]{5}",x)>
string ok
<cfelse>
String not ok
</cfif>
We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
/D means non DIGIT (0-9) 'x%12345' would pass the test.
you also added $ to the end so it can ONLY be 7 chars long, r0nke eluded it could be longer but didn't care about what followed the first 7.
We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.