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

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