2011-12-15 35 views
3

我只是想匹配第一個實例,誰能讓我知道你將如何去做這件事?經典ASP中的正則表達式VB

'RegEx to get Image 
Dim re, matches, Img 
Set re = new RegExp  ' creates the RegExp object 
re.IgnoreCase = true 
re.Global = true 
re.Pattern = "<img.*(.|\n)*?/>" 
Set Matches = re.Execute(string) 
Img = "" 

For each Item in Matches 
    Img = Item.Value 
Next 

回答