I\'m trying to return the contents of any tags in a body of text. I\'m currently using the following expression, but it only captures the contents of the first tag and ign
Try using the global flag:
document.body.innerHTML.match(/([\s\S]*?)<\/script>/gmi)
Edit: added multiple line and case insensitive flags (for obvious reasons).