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 searchString contains special characters, i.e, (
, &
, <
, etc, it's not working.
Example string "hello("
Please help me.