Answers for "how to check for special symbol in regex"

1

regex to check if string contains special characters javascript

var format = /[ `!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~]/;
//            ^                                       ^   
document.write(format.test("My@string-with(some%text)") + "<br/>");    //true
document.write(format.test("My string with spaces") + "<br/>");        //true 
document.write(format.test("MyStringContainingNoSpecialChars"));       //false
Posted by: Guest on July-05-2020
0

regex match numbers and special characters

echo %H1E2L+L#O! | sed 's/[^A-Z!]//g'	#replaces number and special
characters which aren't ! or an uppercase letter A-Z
Posted by: Guest on November-27-2020

Code answers related to "how to check for special symbol in regex"

Code answers related to "Javascript"

Browse Popular Code Answers by Language