Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
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…

597 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