vbs正则表达式 对网址

Dim re, s ,colMatches,match
Set re = New RegExp
re.Global = True
re.Pattern = "http://(\w+[\w-]*\w+\.)*\w+"
s = "http://www.kingsley-hughes.com is a valid web address. And so is "
s = s & vbCrLf & "http://www.wrox.com. And "
s = s & vbCrLf & "http://www.pc.ibm.com - even with 4 levels."
Set colMatches = re.Execute(s)
For Each match In colMatches
MsgBox "Found valid URL: " & match.Value
Next

dim re,s
set re= new RegExp
re.Pattern = "France"

s = "The rain in France falls mainly on the plains."
msgbox re.replace(s,"Spain")

你可能感兴趣的:(vbs 正则表达式 网址)