| | |
Regular Expression
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 1
Reputation:
Solved Threads: 0
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
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
![]() |
Similar Threads
- Regular Expression (Perl)
- How to write javascript regular expression for this case? (JSP)
- regular expression (PHP)
- Regular Expression Matching New Line (Perl)
- Regular expression (Perl)
- Looking for table rows with Regular expression. (PHP)
Other Threads in the JSP Forum
- Previous Thread: having problem for display the piechart in JSP
- Next Thread: How I can deactivate backward option in jsp web pagewhen I logout as a user
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web





