Regex for diacritics

As Casimir et Hippolyte stated in comments, Javascript does not support \p{L} unicode character class.

You can create your own character class:

[a-zA-Z0-9À-ž]

Demo

If you want to allow those characters but replace characters outside those ranges, negate the character classes:

[^a-zA-Z0-9À-ž]

Demo

Or as pointed out in comments:

[A-zÀ-ÖØ-öø-įĴ-őŔ-žǍ-ǰǴ-ǵǸ-țȞ-ȟȤ-ȳɃɆ-ɏḀ-ẞƀ-ƓƗ-ƚƝ-ơƤ-ƥƫ-ưƲ-ƶẠ-ỿ]

The [À-ž] character class includes the following characters, highlighted in yellow below.

enter image description here