I am using JS Animated Contact Form with this line of validation regex:
rx:{\".name\":{rx:/^[a-zA-Z\'][a-zA-Z-\' ]+[a-zA-Z\']?$/,target:\'input\'}, other fie
I came up with a combination of different ranges:
[A-Za-zÀ-ž\u0370-\u03FF\u0400-\u04FF]
But I see that it misses some letters of @SambitD proposal, refer to: https://rubular.com/r/2g00QJK4rBS8Y4
The problem with the \uXXXX approach is, that it is not supported by all Regex flavours. For example Visual C++ does not support it. There, you would need to enumerate the actual letters.
I recommend to use a tool like https://www.regexbuddy.com/ that knows as many flavors as possible.
I used
A-Za-z-ÁÀȦÂÄǞǍĂĀÃÅǺǼǢĆĊĈČĎḌḐḒÉÈĖÊËĚĔĒẼE̊ẸǴĠĜǦĞG̃ĢĤḤáàȧâäǟǎăāãåǻǽǣćċĉčďḍḑḓéèėêëěĕēẽe̊ẹǵġĝǧğg̃ģĥḥÍÌİÎÏǏĬĪĨỊĴĶǨĹĻĽĿḼM̂M̄ʼNŃN̂ṄN̈ŇN̄ÑŅṊÓÒȮȰÔÖȪǑŎŌÕȬŐỌǾƠíìiîïǐĭīĩịĵķǩĺļľŀḽm̂m̄ʼnńn̂ṅn̈ňn̄ñņṋóòôȯȱöȫǒŏōõȭőọǿơP̄ŔŘŖŚŜṠŠȘṢŤȚṬṰÚÙÛÜǓŬŪŨŰŮỤẂẀŴẄÝỲŶŸȲỸŹŻŽẒǮp̄ŕřŗśŝṡšşṣťțṭṱúùûüǔŭūũűůụẃẁŵẅýỳŷÿȳỹźżžẓǯßœŒçÇ
which supports almost all the chars in Europe. Source of truth
You should use in your regex unicode codes for characters, like \u0080
.
For German language, I found following table:
Zeichen Unicode
------------------------------
Ä, ä \u00c4, \u00e4
Ö, ö \u00d6, \u00f6
Ü, ü \u00dc, \u00fc
ß \u00df
(source http://javawiki.sowas.com/doku.php?id=java:unicode)
Try using this:
/^[\u00C0-\u017Fa-zA-Z'][\u00C0-\u017Fa-zA-Z-' ]+[\u00C0-\u017Fa-zA-Z']?$/
I have added the unicode range \u00C0-\u017F
to the start of each of the square bracket groups.
Given that /^[\u00C0-\u017FA-Za-z]+$/.test("aeiouçéüß")
returns true
, I expect it should work.
Credit to https://stackoverflow.com/a/11550799/940252.