i have the following piece of code to count number of special characters in a string...somehow it does not return what i'd like
var sectionToCheck = $('input').val(); //it could be any kind of string entered in an input field such as "Hello @&% everybody"
var specialChars = /^[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]*$/;
var allFoundCharacters = sectionToCheck.match(specialChars);
console.log(allFoundCharacters);
It returns a null value for the variable allFoundCharacters. Any tips please?