Click here to Skip to main content
15,906,625 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
validation expression for password must be contain letters ,numbers ,underscore,whitespace character,speical characters in asp.net, at leaset 8.
Posted
Comments
Thanks7872 26-Nov-13 0:56am    
And? What is the question. This is just a list of requirements.
♥…ЯҠ…♥ 26-Nov-13 2:19am    
Any number of white space,spl characters?

Hi Ramesh,

Here is the regular expression that you want

^[\w\s*\W]{8}$
Here


^ - Start of line
\w - Any word character (letter, number, underscore)
\s* - Any whitespace character with one or more times
\W - Any non-word character
{8} - Denotes the number of characters.
$ - End of line


Accepted input

PASSWORD
PAs$WOrd
Amer!ca)
!@#$%^&*
ABX !@#
12ABX123
333_4_ _


You can test/learn the regex in http://www.rubular.com/
Hope this helps you a bit.

Regards,
RK
 
Share this answer
 
v3
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900