[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 321
  • Last Modified:

Help with reg Exp for web.config

Hi there

Hope you can help me out

In the web.config I have to add a Property called

PasswordStrengthRegularExpression

the RegExp must be

English uppercase characters (A - Z)
English lowercase characters (a - z)
Base 10 digits (0 - 9)

... and you MUST have 1 of each item i.e.

1 UpperCase char
1 LowerCare char
1 number between 0 - 9

Can someone please help me with the regexp

thanks
0
mousemat24
Asked:
mousemat24
  • 2
  • 2
1 Solution
 
käµfm³d 👽Commented:
This should do it:

^(?=[^A-Z]+[A-Z])(?=[^a-z]+[a-z])(?=[^0-9]+[0-9])[A-Za-z0-9]+$

Open in new window

0
 
mousemat24Author Commented:
Hi

I went to this site, added your regex to it

reg

and entered the following text, that "should" of worked, but did not

BrickWall08
0
 
käµfm³d 👽Commented:
What a difference a single character can make!!  I used the wrong quantifier:

^(?=[^A-Z]*[A-Z])(?=[^a-z]*[a-z])(?=[^0-9]*[0-9])[A-Za-z0-9]+$

Open in new window

0
 
mousemat24Author Commented:
that worked, thank you so much for your help!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now