Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Regular Expression help

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,44410
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Regular Expression help
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Regular Expression help - 3/13/2007 6:41:43 AM   
  2Komplex

 

Posts: 1
Score: 0
Joined: 10/31/2006
Status: offline
I am trying to build a reg exp to evaluate a password for repeating characters.  I want to discard any password with more than two repeating characters.  The password contain Upper case, Lower case, numbers, and special characters. 12 characters in all.

For example:

!A9eggg&h8n+   Flagged

!A9eggt&h8n+   Not Flagged

 
 
Post #: 1
 
 RE: Regular Expression help - 3/13/2007 6:52:44 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Option Explicit
Dim oRE : Set oRE = New Regexp
Dim strTest
oRE.pattern = "(.)\1{2,}"
strTest = "!A9eggg&h8n+"
WScript.Echo CStr(oRE.Test(strTest))
strTest = "!A9eggt&h8n"
WScript.Echo CStr(oRE.Test(strTest))

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to 2Komplex)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Regular Expression help Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts