Regular expression for twitter username

前端 未结 9 2468
挽巷
挽巷 2020-12-15 03:43

I need a javascript regular expression to match twitter usernames.

The username is entered by the user while signing up, so I don\'t want to distract them with too m

9条回答
  •  [愿得一人]
    2020-12-15 04:21

    This could be help for a Full Match :

    ^@(?=.*\w)[\w]{1,15}$
    

    Testing: @John_Doe2000

    Results:

    Match 1
    Full match  0-13    @John_Doe2000
    

    Try Here

提交回复
热议问题