Solved

How to customize Regular Expression for a strong password in asp classic?

Posted on 2008-10-07
3
263 Views
Last Modified: 2012-05-05
Hi experts,
I'm trying to customize regular exp. to only allow certain special characters like #$@^+. the one I'm using is working but not quiet the way I want. I would reject any special charancter that I do not allow but the problem is if I enter a valid special character and then I enter a non valid special character it will accept it because it finds a valid one in the string. Here's the one I use:
Dim RegExpPass
Set RegExpPass = new RegExp
With RegExpPass
.Pattern = "^.*(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$^+]).*$"
.IgnoreCase = True
.Global = True
End With
0
Comment
Question by:bryanche
  • 2
3 Comments
 
LVL 27

Accepted Solution

by:
ddrudik earned 125 total points
ID: 22662420
.Pattern = "^(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$^+])[\da-zA-Z@#$^+]*$"

Note that your use of:
.IgnoreCase = True
Invalidates your apparent requirement of one or more A-Z chars:
(?=.*[A-Z])
0
 

Author Comment

by:bryanche
ID: 22662602

Hi ddrudik,
your solution was fantastic. Really appreciate it.
0
 
LVL 27

Expert Comment

by:ddrudik
ID: 22662898
Thanks for the question and the points.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

929 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

12 Experts available now in Live!

Get 1:1 Help Now