Problem with regular expression

M

Morten

Hi!

I'm trying to validate a password by means of a regular expression. I've
found the following: ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$ which should
guarantee that the password length is between 4 and 8 characters and that it
contains at least 1 lower case letter, 1 upper case letter and 1 numeric
digit. The problem is that no matter what I key in I'm told that it doesn't
match the criteria I've implemented.

Just to make sure that I can use some regular expression I've tried this:
^.{4,8}$ This just ensures that the length is between 4 and 8 characters and
it works OK.

Can somebody help me with this please?

Thanks in advance

Morten
 
M

Morten

Hi!

I'm using a RegularExpressionValidator control in Visual Studio .Net and
that doesn't give me the desired result.

I'll try the tool that you suggest.

Morten

Louis Marascio said:
Morten,

I think your RegEx is right. How are you validating this? Grab
Expresso from http://www.codeproject.com/dotnet/Expresso.asp. It will
let you test your expression w/ test input, etc. I plugged your
expression in and then hit it with some test input and it appears to
work.

Louis
--
Louis Marascio
louis at no spam dot louismarascio dot com



Morten said:
Hi!

I'm trying to validate a password by means of a regular expression. I've
found the following: ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$ which should
guarantee that the password length is between 4 and 8 characters and that it
contains at least 1 lower case letter, 1 upper case letter and 1 numeric
digit. The problem is that no matter what I key in I'm told that it doesn't
match the criteria I've implemented.

Just to make sure that I can use some regular expression I've tried this:
^.{4,8}$ This just ensures that the length is between 4 and 8 characters and
it works OK.

Can somebody help me with this please?

Thanks in advance

Morten
 
M

Morten

Hi again!

I get the expected result with Expresso but I can't get it to work with the
RegularExpressionValidator control in Visual Studio.

Has anybody got a clue why this might happen? Can anybody else make this
work in VS .Net 2003?

Morten

Morten said:
Hi!

I'm using a RegularExpressionValidator control in Visual Studio .Net and
that doesn't give me the desired result.

I'll try the tool that you suggest.

Morten

Louis Marascio said:
Morten,

I think your RegEx is right. How are you validating this? Grab
Expresso from http://www.codeproject.com/dotnet/Expresso.asp. It will
let you test your expression w/ test input, etc. I plugged your
expression in and then hit it with some test input and it appears to
work.

Louis
--
Louis Marascio
louis at no spam dot louismarascio dot com



Morten said:
Hi!

I'm trying to validate a password by means of a regular expression. I've
found the following: ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$ which should
guarantee that the password length is between 4 and 8 characters and that it
contains at least 1 lower case letter, 1 upper case letter and 1 numeric
digit. The problem is that no matter what I key in I'm told that it doesn't
match the criteria I've implemented.

Just to make sure that I can use some regular expression I've tried this:
^.{4,8}$ This just ensures that the length is between 4 and 8 characters and
it works OK.

Can somebody help me with this please?

Thanks in advance

Morten
 

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

Regular expression 4
Regular expression 5
regular expression 7
Regular Expression Help 2
Regular Expression help 2
Validation control problem 3
Regular Expression Text 5
Regular Expression Help 2

Top