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.

see http://blog.getify.com/to-capture-or-not/#stumble


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -