regularexpression

K

Ken

I tried to create "ValidationExpression" for password at least 8 chraters
long.
Do you know how to creat?
I did try "/^[A-Za-z]\w{6,}[A-Za-z]$/".
it didn't seem to work.

Thanks
 
C

Cowboy \(Gregory A. Beamer\)

\w{8}\w?

Just a first glance, but it will guarantee at least 8 characters of any
type.
 
G

Guest

Ken,

you could use "\S{8,}" - if I remember correctly it requires at least 8 non
space characters
 
K

Ken

Thanks, it works.
However, I got other issues.
my password must contain 3 of the following 4 classes:
1. upper case letters A,B,C,....Z
2. lower case letters a,b,c,....z
3. Number 0,1,2...9
4. Puntuation/Symbols ~,!,#,$,.........

Is it possible to valdidate using "RegularExpressionValidator"? if then, How
should it look like?
or Should I use "CustomValidator" OnServerValidate?

Thanks


Sergey Poberezovskiy said:
Ken,

you could use "\S{8,}" - if I remember correctly it requires at least 8
non
space characters

Ken said:
I tried to create "ValidationExpression" for password at least 8 chraters
long.
Do you know how to creat?
I did try "/^[A-Za-z]\w{6,}[A-Za-z]$/".
it didn't seem to work.

Thanks
 
G

Guest

Thanks, it works.
However, I got other issues.
my password must contain 3 of the following 4 classes:
1. upper case letters A,B,C,....Z
2. lower case letters a,b,c,....z
3. Number 0,1,2...9
4. Puntuation/Symbols ~,!,#,$,.........

Is it possible to valdidate using "RegularExpressionValidator"? if then, How
should it look like?
or Should I use "CustomValidator" OnServerValidate?

here is an expression to check if a password is valid for ##1,2,3 or
##1,2,4

^(([a-zA-Z0-9]{8})|([a-zA-Z~!#\$]{8}))$

"hello123" will be accepted
"hello$23" will be not accepted
"hellooo$" will be accepted

If you need more - just add other possible combinations (4x4=16)

(...) | (...) | (...)

However I think a password which will be validated by

(?!^[0-9]*$)(?!^[a-zA-Z]*$)^([a-zA-Z0-9]{8})$

will be strong enough - 8 characters, at least one digit and one
alphabetic character, and must not contain special characters.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top