79770506

Date: 2025-09-20 18:58:38
Score: 1
Natty:
Report link

Yes, there are new bugs in the new library:
When defining a LOOKAHEAD, the library CRASHES as soon as a match is found: Here: (?=§).
I want to find several items delimited between §....§, starting with a date, in a match collection, therefore the lookahead, otherwise the closing § is "eaten" and the next match not found.

That one worked before and now crashes.

Sub CrashTest3()
    Dim R As RegExp
    Dim txt As String
    Set R = new RegExp
    R.Pattern = "§\D{0,4}(\d{4}\-\d{2}\-\d{2}[^\s]*?)\s+(.*?)(?=§)"
    txt = "§AAA§BBB§CCC§2024-07-14 DDD§"
    Debug.Print R.Test(txt)
End Sub

The following works, but misses the second item, e.g. §2025-09-01 XXXX§2025-06-09 YYYY§, therefore the lookahead:

§\D{0,4}(\d{4}\-\d{2}\-\d{2}[^\s]*?)\s+(.*?)§

Useless to say that the library still doesn's support lookbehind or UTF8
When will Microsoft give us a DECENT Regex implementation in VBA ??
It would be so easy, because it is there in .net.
But even trying to create our own COM library is now blocked - can't be registered.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Low reputation (1):
Posted by: Pelton