Set reg1 = New RegExp
reg1.Pattern = "VbScript\=.*?VbsHoldPlay"
reg1.IgnoreCase = True
reg1.Global = True
Set matches = reg1.Execute(iniop.GetSection(modulename))
CMPvbScrip = matches(0)
Set reg1 = Nothing
以上代码是查找字符串"VbScript=" 和"VbsHoldPlay"之间的字符串,但运行后,字符串包括"VbScript=" 和"VbsHoldPlay"
我只需要之间的字符串,怎么写。
reg1.Pattern = "VbScript\=.*?VbsHoldPlay"
reg1.IgnoreCase = True
reg1.Global = True
Set matches = reg1.Execute(iniop.GetSection(modulename))
CMPvbScrip = matches(0)
Set reg1 = Nothing
以上代码是查找字符串"VbScript=" 和"VbsHoldPlay"之间的字符串,但运行后,字符串包括"VbScript=" 和"VbsHoldPlay"
我只需要之间的字符串,怎么写。
reg1.Pattern = "VbScript\=(.*?)VbsHoldPlay"
reg1.IgnoreCase = True
reg1.Global = True
Set matches = reg1.Execute(iniop.GetSection(modulename))
for i=0 to matches.count-1
debug.print matches(i).SubMatches(0)
next
Set reg1 = Nothing