开发者

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

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜