Regular Expression

Ø

Øyvind Isaksen

Can anyone please help me make i regular expression (asp.net / vb.net) that
check if a password is more than 5 digit/char?

Example passwords:
whK5v = valid password
hd3 = invalid password
lksds883 = valid password
..
..
..

Thanks
 
F

Fao, Sean

Øyvind Isaksen said:
Can anyone please help me make i regular expression (asp.net / vb.net) that
check if a password is more than 5 digit/char?

Why use regular expressions? Just check the length. Or do you have
more criteria?

Hope that helps,
 
Ø

Øyvind Isaksen

Yes, but how do I check this length with regular expression? Isn't that the
way to do it?

Thanks for your reply,
Best regards
Isaksen
 
D

David Veeneman

You shouldn't have to use a regular expression to get the length of the
password. The easiest way to get it is to put the password in a string (or
read the text property of a text box) and get its length, like this.

int passwordLength = textBoxPassword.Text.Length

Hope that helps.
 
J

john smith

Øyvind Isaksen said:
Yes, but how do I check this length with regular expression? Isn't that the
way to do it?

Thanks for your reply,
Best regards
Isaksen

Too much overhead for something that doesn't require it (only a simple
basic string operation is needed - like David answered). Regex'es are
intended to match against complex patterns, not check string lengths.
 

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

Members online

Forum statistics

Threads
473,778
Messages
2,569,605
Members
45,238
Latest member
Top CryptoPodcasts

Latest Threads

Top