What characters are allowed in named subpattern and is it possible to escape inside named subpattern?
(?<name>\w+)
I want to use this example http://www.php.net/manual/en/function.preg-match.php#example-3946 and want to have "hello-name" instead of "name" for example.
PCRE only allows alphanumeric characters and underscores for subpattern names:
http://regexkit.sourceforge.net/Documentation/pcre/pcrepattern.html#SEC14
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With