I've seen a lot of posts with regex for specific tags but what if a tag has a class or an ID or any attribute for that matter. How would I get just the text between the span tags. I have some places where the span and h tags doesn't have any class but most have.
const html = <h4><span class="title">Lorem ipsum..</span></h5><h3><span id="bl">xvcxv</span>
I've tried this from another post but its not what I'm after.
html.match(/<span>([\s\S]*)(?=<\span/>)/g);