preg_match accented characters

Solution 1:

This pattern should work:

/^\pL+(?>[- ']\pL+)*$/u

demo

But feel free to adapt it for more exotic names (For example names with a trailing quote or an apostrophe).

Solution 2:

~^([\p{L}-\s']+)$~ui

Matches the following names:

  1. Jean-François d'Abiguäel
  2. François Hollande
  3. Père Noël

See a demo on regex 101.