preg_match with international characters and accents

Add the UTF-8 modifier flag (u) to your expression:

/^\p{L}+$/ui

There is also no need to wrap \p{L} inside of a character class.

Leave a Comment