Regex pattern including all special characters

后端 未结 18 1606
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-02 09:18

I want to write a simple regular expression to check if in given string exist any special character. My regex works but I don\'t know why it also includes all numbers, so wh

18条回答
  •  囚心锁ツ
    2020-12-02 09:32

    Here is my regular expression, that I used for removing all the special characters from any string :

    String regex = ("[ \\\\s@  [\\\"]\\\\[\\\\]\\\\\\\0-9|^{#%'*/<()>}:`;,!& .?_$+-]+")
    

提交回复
热议问题