有人能帮我写一个preg_match
来验证字母字符和法语重音字符吗?到目前为止,我想出了:
'/^[-[:alpha:]''[:space:],_'/.]{2,30}$/ui'
您可以使用unicode属性:
preg_match("~[-'p{L}''s,_/.]{2,30}$~u", $string, $matches);
其中'p{L}
代表任何字母。
有人能帮我写一个preg_match
来验证字母字符和法语重音字符吗?到目前为止,我想出了:
'/^[-[:alpha:]''[:space:],_'/.]{2,30}$/ui'
您可以使用unicode属性:
preg_match("~[-'p{L}''s,_/.]{2,30}$~u", $string, $matches);
其中'p{L}
代表任何字母。