I have added a TODO to the code, but I didn't want to fix it (unnecessarily) in the same PR as the extended character classes.
If you have: [\d-] it's considered OK, because the hyphen is at the end of the class.
Perl also accepts these cases: [\d-\Q\E] and /[\d- ]/xx, but PCRE2 rejects them due to insufficient lookahead when checking "is the hyphen at the end of the character class".
I have added a TODO to the code, but I didn't want to fix it (unnecessarily) in the same PR as the extended character classes.
If you have:
[\d-]
it's considered OK, because the hyphen is at the end of the class.Perl also accepts these cases:
[\d-\Q\E]
and/[\d- ]/xx
, but PCRE2 rejects them due to insufficient lookahead when checking "is the hyphen at the end of the character class".