Strip image URLs from data using Regex in Classic ASP

sanjosemom

New Member
I was just wondering how to write a function which takes a string and strips out everything which isn't an image URL?I presume the best course would be regEx but I'm not sure.The content type doesn't matter, just needs to be an URL with extension of either jpg, gif or png.I did have a go but to no avail.\[code\]Function RegExResults(strTarget, strPattern) Set regEx = New RegExp regEx.Pattern = strPattern regEx.Global = true Set RegExResults = regEx.Execute(strTarget) Set regEx = NothingEnd FunctionSet arrResults = RegExResults(data, "(http://)([a-zA-Z0-9\/\.])*")For each result in arrResults Response.Write(result.Submatches(0)) & "<br>"NextSet arrResults = Nothing\[/code\]
 
Top