Abdallah Boodhun Abdallah Boodhun - 1 year ago 100
PHP Question

Php preg_match for french characters

Can anyone help me to write a

to validate alpha characters and french accented characters also? So far I came up with:


Answer Source

You could use unicode properties:

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

Where \p{L} stands for any letter.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download