Find and replace *highlighted* text

Hello everyone,

I have an input where the user can input some text. I would like them to be able to input for example “Hello, here is my text”

And when I display this text I would like to find all words that are “wrapped” with ** and display them in a highlited color for example, lets say red.

Similar to using **strong**tags here in this text editor. How would I catch all words wrapped within the asterisk and add color codes or other custom css to those words?

Thanks

Check this:

You can use regex pattern to extract the text and then use the find and replace function to make it highlight. You may use CSS tags

Thanks guys! I’ll look into this!

This topic was automatically closed after 70 days. New replies are no longer allowed.