I searched for Hi and low, but could not find the exact answer to what I am trying to do ...
I would like to find any text with __ at the beginning and / __ at the end ( i.e. "in the middle of the sentence __this/__ could be underlined, and __this(!) can also/__ be underlined")). Thus, it can be one word or several characters with any characters, including spaces. be different words and combinations - in the same paragraph - starting with __ and ending with / __.
Once discovered, I would like to remove __ and / __ and replace them with HTML - for example, a div tag. So:
__sample string /__
it should be:
<div>sample string</div>
I know that I have to use capture groups, but I cannot find a way to do this.
JavaScript:
.matchseems to match and put the results in an array - but how do I get back into the string and replace the results found?
JQuery:
.replace , , ...
!