I have a complex VBA project which I have used for ten or fifteen years with no issues. All of sudden, today it started to crash with a non-VBA error message. I am guessing this is referring to the underlying code for the VBScript Regular Expressions 5.5 reference:
Microsoft Visual C++ Runtime Library
Assertion failed!
Program: ...
File: g:\vba\src\65_VC8\VBA\rt\regexpbase.cxx
Line: 2063Expression: ibLim == m_ibMin
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts
(Press Retry to debug the application - JIT must be enabled)
[Abort] [Retry] [Ignore]
The following code snippet, at least on my computer, reproduces the problem (this code uses early binding, but the same error occurs using late binding):
Option Explicit
Sub due()
Dim RE As RegExp
Const sPATepi As String = "(?!.*sample)\\([^\\]+)\\(S\d\d(?:E\d{2,3}(?:-E?\d{2,3})?)+)\\(.*)(?=\.(?:mkv|avi|mp4|wmv)$)"
Const Test As String = "\\DS718\Video\TV Shows\Death in Paradise\S14E08\Episode 8 720p HDTV.mkv"
Set RE = New RegExp
With RE
.Global = True
.IgnoreCase = True
.Pattern = sPATepi
.Multiline = True
End With
'Crashes if result = True
Debug.Print RE.Test(Test)
End Sub
RE.Test(test) in the above code evaluates to True in a regex tester (as it has on this program for years).
Simpler regular expressions do not have this problem. (eg. pattern = "\d+" will evaluate to True and not crash).
I really don't know where to go with debugging this further. I have run DISM with no errors found.

vbscriptregex engine, the escaping is necessary to properly match the `\`s seen in the target. And the regex has matched that particular target almost daily for the past five months with no errors.debug.printfor the pattern, and also for the target was how I constructed the test vba macro. Also, using both the pattern and the target in regex buddy shows that the regex matches the part of the target it is designed to match:\Death in Paradise\S14E08\Episode 8 720p HDTVlookahead:Dim RE As New RegExp: Set RE = GetObject("", "VBScript.RegExp"). WhyGetObjectworks andCreateObjector the original code don't work is not clear. Perhaps now that the REGEX engine is built into VBA,GetObjectis picking up that code rather than the.dll