Solved

Regular Expression to check a password.

Posted on 2010-08-16
3
449 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 500 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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Back in July, I blogged about how Microsoft's new server pricing model, combined with the end of the Small Business Server package, would result in significant cost increases for many small businesses (see SBS End of Life: Microsoft Punishes Small B…
I have put this article together as i needed to get all the information that might be available already into one general document that could be referenced once without searching the Internet for the different pieces. I have had a few issues where…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

803 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