Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Regex HELP!!

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Regex 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 >>
 Regex HELP!! - 12/25/2007 11:31:41 AM   
  yfki

 

Posts: 78
Score: 0
Joined: 12/12/2007
Status: offline
How do I split a string like "http://www.google.com/abc%20123.mp3"
into 2 strings like so I can seperate them ? (http://www.google.com/) (abc%20123.mp3)

Totally new with regex, sorry


Call ReplaceTest("(z\\)(/w)", "$1")

Function ReplaceTest(patrn, replStr)

Dim regEx, str1               ' Create variables.

  str1 = "http://www.google.com/abc%20123.mp3"

Set regEx = New RegExp            ' Create regular expression.

regEx.Pattern = patrn            ' Set pattern.

regEx.IgnoreCase = True            ' Make case insensitive.

ReplaceTest = regEx.Replace(str1, replStr)   ' Make replacement.

MsgBox ReplaceTest

End Function
 
 
Post #: 1
 
 RE: Regex HELP!! - 12/25/2007 9:25:50 PM   
  TNO


Posts: 1247
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
A regular expression isn't really necessary, just split using the forward slash:


      

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to yfki)
 
 
Post #: 2
 
 RE: Regex HELP!! - 12/26/2007 2:04:28 AM   
  dm_4ever


Posts: 2641
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
if you wanted to use a regular expression....


      

_____________________________

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 yfki)
 
 
Post #: 3
 
 
 
  

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 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