--- Comment #5 from Philip Hazel <ph10@???> ---
Unfortunately, wishing for something impossible does not make it possible. As
Zoltan has said, PCRE has no concept of files. It (the PCRE library) is a
pattern matching engine; the pcre2_match() function matches a regex pattern
(previously compiled by pcre2_compile()) against a string, e.g "^abc$" matched
against "some string". It knows nothing of files.
So, it is clear we are communicating at cross-purposes. Please explain what you
are really trying to do.