允许命名的子模式字符

Cod*_*ler 3 php regex escaping character preg-match

命名子模式中允许使用哪些字符,是否可以在命名子模式中进行转义?

(?<name>\w+)
Run Code Online (Sandbox Code Playgroud)

我想使用这个例子http://www.php.net/manual/en/function.preg-match.php#example-3946,并希望有"hello-name"而不是"name".

mar*_*rio 5

PCRE仅允许子模式名称使用​​字母数字字符和下划线:http:
//regexkit.sourceforge.net/Documentation/pcre/pcrepattern.html#SEC14