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
I have defined one pattern to look for any of the ASCII Special Characters ranging between 032 to 126 except the alpha-numeric. You may use something like the one below:
To find any Special Character:
[ -\/:-@\[-\`{-~]
To find minimum of 1 and maximum of any count:
(?=.*[ -\/:-@\[-\`{-~]{1,})
These patterns have Special Characters ranging between 032 to 047, 058 to 064, 091 to 096, and 123 to 126.