Using regex 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 regex doesn’t seem to work as expected. According to a different post, a dynamic regex should be passed as a new RegExp()
.