• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.