Regex in Classic ASP VB

…衆ロ難τιáo~ 提交于 2019-12-23 16:07:22

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/8519144/regex-in-classic-asp-vb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!