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

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