Solved

Regular Expression to check a password.

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

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 …
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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