JSFiddle - React, Tailwind, and code Playground

by sarathsprakash

JavaScript

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