开发者

Allowed named subpattern characters

开发者 https://www.devze.com 2023-03-01 06:43 出处:网络
What characters are allowed in named subpattern and is it possible to escape inside named subpattern?

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号