I've spent almost the whole day to figure this out, but I can't find a way to do it by myself.
I'm trying to code a java script function that could do this:

a string for example: This is a bold('word')
And replace bold('word') with <b>word</b>
So at the end, I could fill in any word I want.

I guess the function has to find bold(' anythingIWant ') in a string
select in between ' ' (so you keep anythingIWant)
replace the whole bold(' anythingIWant ') with <b>anythingIWant</b>

Thanks in common!