Regular Expression

Reply

Join Date: Oct 2006
Posts: 1
Reputation: knittingguy is an unknown quantity at this point 
Solved Threads: 0
knittingguy knittingguy is offline Offline
Newbie Poster

Regular Expression

 
0
  #1
Oct 12th, 2006
Hi all,

I am having a little problem with regular expression. I have a change password application and I want to make sure the password contains at least one numeric character. The regular expression that I am using is, [a-zA-Z]+[0-9]+|[0-9]+[a-zA-Z]+.

If I put in "testing", it would return false, which is good because there isn't any numeric character in the string.
If I put in "testing123", it would return true, which is good too.

However, if I put in "1testing123", it would return false but it should return true because [0-9]+[a-zA-Z]+ should take care of this situation.

May I ask what am I doing wrong here?

Thanks in advance,
Monte
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC