JSFiddle - React, Tailwind, and code Playground
JavaScript
/*regex to match only string of symbols*/
var x =" "
var sym=/[-!$%^&*()#@©_+|~=`{}\[\]:";'<>?,.\/]?[\w]/;
if(!x.match(sym))
alert("matched");
else
alert("not matched");
/*regex to match only string of symbols*/
var x =" "
var sym=/[-!$%^&*()#@©_+|~=`{}\[\]:";'<>?,.\/]?[\w]/;
if(!x.match(sym))
alert("matched");
else
alert("not matched");