正则expression式正面Lookbehind问题与Excel VBA

我正在运行VBA(Excel 2003)并testing了正面的lookbehind正则expression式模式。 我运行下面的函数,但得到以下错误:

Run-time error '5017': Method 'Execute' of object 'IRegExp2' failed

我也试过Set re = CreateObject("vbscrip.regexp")
但我得到同样的错误。 我已经成功testing了一些积极的lookahead,他们的工作。 这只是后面的问题。 我用Expressotesting了下面的模式,它工作正常。 这是VBA特有的味道问题吗?

 Function regexSearch(pattern As String, source As String) As String Dim re As RegExp Dim matches As MatchCollection Dim match As match 'Create RegEx object pattern = "(?<=a)b" source = "cab" Set re = New RegExp re.Multiline = False re.Global = True re.IgnoreCase = False re.pattern = pattern 'Execute Set matches = re.Execute(source) 'Output For Each match In matches str = str & match & " " Next match regexSearch = str End Function 

这是特别的vbscript (因此vba )。

VBScript不支持向后看(负面或正面)