user997357
user997357

Reputation: 77

Regex in Classic ASP VB

I just want to match the first instance, could anyone let me know how you would go about doing this?

'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

Upvotes: 3

Views: 7917

Answers (1)

Matt
Matt

Reputation: 4795

The Global property should be false, rather than true.

The property is described at http://msdn.microsoft.com/en-us/library/tdte5kwf(v=VS.85).aspx.

Upvotes: 3

Related Questions