find a regular expression to check letter,chinese character and slash(/)

前端 未结 1 1040
广开言路
广开言路 2021-01-16 09:08

i want to check users\' input value when he input his name, if his input is a English name, the name only contains letters and must be divided with slash(/), example:

相关标签:
1条回答
  • 2021-01-16 09:42

    Not clear exactly what you want, maybe this:

    ^(?=.{1,20}$)[a-zA-Z\u4E00-\u9FA5]+(?:\/[a-zA-Z\u4E00-\u9FA5]+)?$
    
    0 讨论(0)
提交回复
热议问题