?
Solved

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

Posted on 2008-10-07
3
Medium Priority
?
269 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
[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 27

Accepted Solution

by:
ddrudik earned 500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

752 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