473,403 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

ASP regular expression check for password needing numerals and characters

I'm trying to only allow password entries that have at least one
numeric character, and 7 to 15 characters long. The below script is
not filtering it properly, it keeps saying all the entries are bad
when i am entering mixed passwords:

<%'' ASP validation for password criteria
dim strpassword
strpassword = request.form("password")
Function CheckString(strpassword, strRegExp)
Dim re
Set re = new RegExp

re.Pattern = strRegExp

CheckString = re.Test(strpassword)
End Function

'Make sure it's in the format of at least one numeral, 7 to 15
characters
If CheckString(strpassword, "^(?=.*\d).{7,15}$") then
response.write "good"
Else
response.write "bad"
End If

%>

???
netsports

May 14 '07 #1
1 3241
Your code works fine for me

try writing password to screen to check you passing the right string

response.write strpassword

".Net Sports" <ba********@cox.netwrote in message
news:11**********************@l77g2000hsb.googlegr oups.com...
I'm trying to only allow password entries that have at least one
numeric character, and 7 to 15 characters long. The below script is
not filtering it properly, it keeps saying all the entries are bad
when i am entering mixed passwords:

<%'' ASP validation for password criteria
dim strpassword
strpassword = request.form("password")
Function CheckString(strpassword, strRegExp)
Dim re
Set re = new RegExp

re.Pattern = strRegExp

CheckString = re.Test(strpassword)
End Function

'Make sure it's in the format of at least one numeral, 7 to 15
characters
If CheckString(strpassword, "^(?=.*\d).{7,15}$") then
response.write "good"
Else
response.write "bad"
End If

%>

???
netsports
Jun 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Ron Adam | last post by:
Is it possible to match a string to regular expression pattern instead of the other way around? For example, instead of finding a match within a string, I want to find out, (pass or fail), if...
5
by: John | last post by:
I am new in Regular Expression. Could someone please help me in following expression? 1. the string cannot be empty 2. the string can only contains AlphaNumeric characters. No space or any...
18
by: Lit | last post by:
Hi, I am looking for a Regular expression for a password for my RegExp ValidationControl Requirements are, At least 8 characters long. At least one digit At least one upper case character
0
by: AAaron123 | last post by:
Been playing with asp:changepassword and have it looking OK except that I can't elininate or change the title at the top that says "Change Your Password". It's a repeat of my pages title. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.