How to check for special characters using regex

前端 未结 3 898
执念已碎
执念已碎 2021-01-02 18:18

NET. I have created a regex validator to check for special characters means I donot want any special characters in username. The following is the code

Regex         


        
3条回答
  •  借酒劲吻你
    2021-01-02 18:58

    Change your regex to ^[a-zA-Z0-9_@.-]+$. Here ^ denotes the beginning of a string, $ is the end of the string.

提交回复
热议问题