in reply to Looking to highlight my text

Easy - replace the text with something that sets the CSS class. Allowing user submitted regexes is somewhat dodgy without precautions - I'm making sure your user data is safe by using \Q\E on it.s((\Q$match\E))(<span class="found_text">$1</span>)sg