Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Regex how to?

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Regex how to?
  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 >>
 Regex how to? - 9/20/2007 9:35:38 PM   
  4scriptmoni


Posts: 208
Score: 0
Joined: 5/3/2007
Status: offline
I wish i knew regex... well i am having little problem here.
I got a pattern for email, but it does not include NUMBERS..
I must get a match only if the email has asndaisdnas12@asd.com  The 2 numeric right before the @ is what i am searching.
Its a spam related attack, hope someone can help
here is the pattern i am now using

strPattern = "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$"

thanks,

_____________________________

Enterprise Microsoft Scripts
Exchange, Login/Logout Monitor,TS, Monitoring, Security, AD, etc...
http://www.felipeferreira.net
 
 
Post #: 1
 
 RE: Regex how to? - 9/21/2007 2:45:55 AM   
  dm_4ever


Posts: 2664
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
How about something like this...


      

This is sort of what's going on
^             - start of string
[a-zA-Z]     - any letter
[\w\.\-]*     - any letter/number/underscore, period, hyphen; occuring 0x or more
\d{2}        - 2 numbers
@            - literal @ character
\w+            - any letter/number/underscore; occuring 1x or more
\.            - period
[a-zA-Z]+    - any letter; occuring 1x or more
$            - end of string

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to 4scriptmoni)
 
 
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 >> Regex how to? 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