[#5423] Fix preg_match to work with older PCRE versions

- Use `?P<...>`, not `?<...>`
Merge pull request #5423