need help in writing a regex
I want to highlight the text when it is searched.
But I’m unable to write a proper regex. Basically, my search term is present within the tags as a class name and also the text is there outside the tags.
On search of that term it is highlighting the text within the also due to which the span tags opens up and breaks.
So I wrote this regex -> var searchRegExp = new RegExp(’(’ + searchTerm + ‘) +"(?!([^<]+)?>)"’, ‘gi’);
Now the problem is that if my search term is having > ,this also is not highlighted when searched.
Help me with the Regex.
This is my Regex which is not working properly -> var searchRegExp = new RegExp(’(’ + searchTerm + ‘) +"(?!([^<]+)?>)"’, ‘gi’);