Solved

Regular Expression to check a password.

Posted on 2010-08-16
3
452 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

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…
Experts-Exchange users below are the steps you can follow to upgrade your Lync server to latest CU's or cumulative updates. Note: Perform it during non-production hours.   Step 1: Backup your lync and SQL server database. Follow below article: h…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

688 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