Welcome Guest, Not a member yet? Register   Sign In
Regex help
#1

[eluser]gigas10[/eluser]
Can someone please help me, my regular expression is not doing what I need it to do.
What I need is 4 characters, a-z uppercase or lowercase, followed by at least 1 digit to inifinite amount of digits. Current I have:
Code:
/^\w{4}\d+$/

It's weird, test cases I've tried:

ssss2 - Succeed
ssss2222 - Succeed
s2 - Fail
sss2 - Fail
s2323424 - Succeed

Seems its treating \w to work even if digits are supplied, can anyone help me? Thank you.


Messages In This Thread
Regex help - by El Forum - 01-07-2010, 01:21 PM
Regex help - by El Forum - 01-07-2010, 01:38 PM
Regex help - by El Forum - 01-07-2010, 02:03 PM
Regex help - by El Forum - 01-07-2010, 03:43 PM
Regex help - by El Forum - 01-07-2010, 06:32 PM
Regex help - by El Forum - 01-09-2010, 05:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB