Okay I have spent a long time looking at this and it seems the problem is related to internal PCRE2 settings/optimizations that happen when DOTSTAR is is used to start a regular expression search pattern.
It appears you can turn off this behaviour by prefacing that expression as follows:
(*NOTEMPTY)
which tells PCRE2 not to return any empty matches.
So please try the following:
(*NOTEMPTY).*
as your search pattern. It should give you what you want.
|