我已经知道\w在PCRE中(特别是PHP的实现)有时可以匹配一些非ASCII字符,具体取决于系统的语言环境,但是呢[a-z]?
我不这么认为,但我注意到Drupal的核心文件之一中的这些行(包括/ theme.inc,简化):
// To avoid illegal characters in the class,
// we're removing everything disallowed. We are not using 'a-z' as that might leave
// in certain international characters (e.g. German umlauts).
$body_classes[] = preg_replace('![^abcdefghijklmnopqrstuvwxyz0-9-_]+!s', '', $class);
Run Code Online (Sandbox Code Playgroud)
这是真的吗,还是只是有人[a-z]混淆了\w?