1

I am trying to validate names such as these Daniëlle, François en Noël

I want to include all these letters of the unicode table in my regex because names from Norway or France use different letters. What would be a good regex to account for all those?

enter image description here

But I want to exclude all numbers and operators from the unicode table. So it will be just letters a-zA-Z + those special letters.

anonymous-dev
  • 2,897
  • 9
  • 48
  • 112
  • 2
    Can you add a tag for the language you are using? Support for categorising those characters is limited in most regex implementations. Here's an existing answer for JavaScript, where the best support is only available on modern browsers: https://stackoverflow.com/questions/150033/regular-expression-to-match-non-ascii-characters – Jeremy Hunt Oct 17 '21 at 04:37
  • You have to tell us which language / lib / implementation you use – IRA1777 Oct 17 '21 at 06:44

1 Answers1

1

Use dash(-) for range like you did for normal alphabet (a-zA-Z).

[a-zA-ZÀ-ÏÐ-ßà-ïð-ÿ]

I found this works for PHP, Javascript, Golang, Java 8 languages.

doctorgu
  • 616
  • 6
  • 9