Allowed named subpattern characters
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开发者_如何学C example.
PCRE only allows alphanumeric characters and underscores for subpattern names:
http://regexkit.sourceforge.net/Documentation/pcre/pcrepattern.html#SEC14
精彩评论