I am trying to match the list of symbols in regex but somehow the result is always returning with errors
symbol list = !@#$+*{}?<>&’”[]=%^
if (text.match('^[\[\]\!\"\#\$\%\&\'\(\)\*\+\,\/\<\>\=\?\@\[\]\{\}\\\\\^\_\`\~]+$')) {
this.specialChar = true;
} else {
this.specialChar = false;
}
I am getting the following error:
Invalid regular expression: /^[[]!"#$%&'()*+,/<>=?@[]{}\\^_`~]+$/: Nothing to repeat
How do I correctly match the symbols in regex? basically I want to check if text contain any of those symbols.