[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Regular Expression to check a password.

Posted on 2010-08-16
3
Medium Priority
?
462 Views
Last Modified: 2012-05-10
I need a Regular Expression to require two upper case characters and 2 numbers in a password of 8 to 10 characters.  I have found a lot of examples for at least one number and at least one Uppercase but cant seem to find or figure out  the above.
0
Comment
Question by:kelley_foust
  • 2
3 Comments
 
LVL 4

Accepted Solution

by:
monicai earned 2000 total points
ID: 33451699
^(?=.*[A-Z].*[A-Z])(?=.*\d.*\d)[a-zA-Z0-9]{8,10}$

0
 

Author Closing Comment

by:kelley_foust
ID: 33451805
You are a life saver!  What does ?=  actually mean
0
 
LVL 4

Expert Comment

by:monicai
ID: 33452117
positive lookahead assertion.  it is useful if you want to match certain characters without following any order.  repeating the regex twice will force the assertion to repeat twice.

http://www.regular-expressions.info/lookaround.html

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you are trying to access the server, have you ever encountered "The terminal server has exceeded the maximum number of allowed connection" error?  or "The user is attempting to log on to a Terminal Server in Remote Administration mode, but the …
Introduction: Sometimes when I receive a call from my users to solve their problems it is very difficult for me to found their computer IP address. Even finding their computer Host to provide remote support can be a problem.  So I resorted to Goo…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question