I am trying to create a regex in javascript. What I want to do:
- I want to see if there is an html element with
class=“get-me”
anywhere in the string. - If there is I want to replace it with
I found you
.
Examples:
<div class="get-me" />
Result: I found you
<div>Some text <div class="get-me" data-type="data-type" js="js" /> more things happening here</div>
Result: <div>Some text I found you more things happening here</div>
<div>Some text <p class="get-me" /> more things</div>
Result: <div>Some text I found you more things</div>
I m testing <<<<div class="get-me" />
Result: I m testing <<<I found you
Thanks.