Concrete Javascript Regex for Accented Characters (Diacritics)

后端 未结 9 1114
庸人自扰
庸人自扰 2020-11-22 17:22

I\'ve looked on Stack Overflow (replacing characters.. eh, how JavaScript doesn\'t follow the Unicode standard concerning RegExp, etc.) and haven\'t really found a concrete

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 17:38

    from this wiki : https://en.wikipedia.org/wiki/List_of_Unicode_characters#Basic_Latin

    for latin letters, I use

    /^[A-zÀ-ÖØ-öø-ÿ]+$/ 
    

    it avoids hyphens and specials chars

提交回复
热议问题