Javascript string match on static string with special characters
I am performing search on html document using javascript. For that I am
using javascript's match function. Below line is to return all
searchString matchings.
var searchResults = document.body.innerText.match(RegExp(searchString,'gi'));
The problem is, if the searhString contains special characters, i.e, (, &,
<, etc, it's not working.
Example string "hello("
Please help me.
No comments:
Post a Comment