Solved

Regular Expression to check a password.

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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Microsoft has released remote PowerShell capabilities to all commercial Office 365 customers. So you can be controlled via PowerShell and not from the Office 365 admin center Download Windows PowerShell Module for Lync Online http://www.micros…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now