Let's say I have the following code:
<div class="set">
<span data-prefix="[1]">Duck</span>
<span data-prefix="[2]">Dog</span>
<span data-prefix="[3]">Cat</span>
</div>
I need Regex to strip all of the HTML except for the value of data-prefix
.
So the expected output should be:
[1]Duck[2]Dog[3]Cat
I can't figure out how to do this, how can I?