Validate field for all language characters through REGEX

后端 未结 3 1618
隐瞒了意图╮
隐瞒了意图╮ 2021-02-10 01:10

i need to validate a field for empty. But it should allow English and the Foreign languages characters(UTF-8) but not the special characters. I\'m not good at R

3条回答
  •  滥情空心
    2021-02-10 01:53

    You can test for a unicode letter like this:

    str.match(/\p{L}/u)
    

    Or for the existence of a non-letter like this:

    str.match(/[^\p{L}]/u)
    

提交回复
热议问题