javascript - Highlight all characters that are not in regular expression -
i need write function in javascript - angularjs gets string , highlights characters not in [ a-za-z0-9_\-\(\)\+#!@$%,."<>^=\\]
.
how find characters not regular expression? (pay attention string comes users convert html may not good.)
you can use str.split(/([ a-za-z0-9_\-\(\)\+#!@$%,."<>^=\\]+)/)
should return array every second entry being correct parts, , odd parts being incorrect parts.
Comments
Post a Comment