2015-06-23 48 views
0

任何人都可以帮我写一个preg_match来验证字母字符和法语重音字符吗?到目前为止,我想出了:法语字符的PHP preg_match

'/^[-[:alpha:]\'[:space:],_\/.]{2,30}$/ui' 
+2

请通过指出您当前模式的错误来澄清您的问题。 – esmit

回答

0

你可以使用unicode properties

preg_match("~[-\p{L}'\s,_/.]{2,30}$~u", $string, $matches); 

\p{L}代表任何字母。