How to match the international alphabet (English a-z, + non English) with a regular expression?

前端 未结 6 600
夕颜
夕颜 2020-12-20 12:00

I want to allow only entered data from the English alphabet and from the alphabet from Germany.

Like öäü OR France like áê or Chinese like

6条回答
  •  旧巷少年郎
    2020-12-20 12:32

    Since you specifically ask for Unicode, \p{L} is the shortcut for a Unicode letter. Not all regex flavors support this syntax, though. .NET, Perl, Java and the JGSoft regex engine will, Python won't, for example.

    So, for example \b\p{L}+\b will match an entire word of Unicode characters.

提交回复
热议问题