Relative Content

Tag Archive for javascripthtmlreactjsregexreplace

using regexp after removing html elements from a string

I’m trying to remove all HTML elements from an article and adding a highlight class at the end to highlight the search word. Unfortunately, this regexp doesn’t seem to work as expected. According to a different post, a dynamic regexp should be passed as a new RegExp().