读书人

求一正则式.解决思路

发布时间: 2012-01-19 20:57:58 作者: rapoo

求一正则式.
有一文本: about(100,1, "字符串1 ", "字符串2 ", "字符串3 ")

我想把这个文本里的 "字符串1 "提取出来.请问正则式如何写?

[解决办法]
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches   
Set regEx = New RegExp   
regEx.Pattern = "( "[^ "]+ ") " 
regEx.IgnoreCase = True   
regEx.Global = True   
Set Matches = regEx.Execute( "about(100,1, "字符串1 ", "字符串2 ", "字符串3 ") ")  
For Each Match in Matches  
RetStr(i) = Match.Value
i=i+1
Next
RegExpTest = RetStr
End Function
会匹配三个字符串,你取缔一个就可

读书人网 >VB

热点推荐