Regex for names with special characters (Unicode)

前端 未结 7 2281
太阳男子
太阳男子 2020-11-28 09:28

Okay, I have read about regex all day now, and still don\'t understand it properly. What i\'m trying to do is validate a name, but the functions i can find for this on the i

7条回答
  •  星月不相逢
    2020-11-28 10:08

    This is the JS regex that I use for fancy names composed with max 3 words (1 to 60 chars), separated by space/single quote/minus sign

    ^([a-zA-Z\xC0-\uFFFF]{1,60}[ \-\']{0,1}){1,3}$
    

提交回复
热议问题