警告:preg_match() [function.preg-match]:编译失败:字符类在偏移量 54 处的范围顺序


Warning: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 54

知道如何解决此错误吗?编码如下。

if ( preg_match( "#^" . $r['match'] . "$#is", $matches[2] ) )

我在代码的另一行上也遇到了相同的错误。编码如下。

if ( preg_match( "#^" . $r['match'] . "$#is", $url ) )

我的猜测是$r[match]包含未在php使用的字符集中定义的字符。Php 不经常使用 Unicode,所以例如,如果它设置为纯 ASCII,它会抱怨字符串中的任何变音符号。