Java Regex to Validate Full Name allow only Spaces and Letters

前端 未结 14 2532
抹茶落季
抹茶落季 2020-11-28 04:50

I want regex to validate for only letters and spaces. Basically this is to validate full name. Ex: Mr Steve Collins or Steve Collins I tried this regex.

14条回答
  •  野性不改
    2020-11-28 05:08

    For those who use java/android and struggle with this matter try:

    "^\\p{L}+[\\p{L}\\p{Z}\\p{P}]{0,}"
    

    This works with names like

    • José Brasão

提交回复
热议问题