/* 听说注明使用的语言、环境
* 问题有可能较容易被解决...
*/
excel 2010 win7
code is as below
Option Explicit
Sub t()
Dim reg As Object
Dim s As String
Dim match As Object
Set reg = CreateObject("VBScript.RegExp")
reg.Pattern = "(123.*?abc)"
reg.ignoreCase = True
reg.MultiLine = False
reg.Global = True
s = "dfr123 123 1235abc"
Set match = reg.Execute(s)
End Sub
and the result is
http://i.imgur.com/VZda4lY.png
小弟想要抓到最短的1235abc 字串 请问要如何更正?