I have got this far /( *)<pre ([^>]+)>([\s\S]*)<\/pre>/g but this fails with something like this:
<p>
  Hello
</p>
<p>
  World
</p>
$3 will be
  Hello
</p>
<p>
  World
What I want is
  Hello
Any help?
Before you downvote, I am not trying to manipulate the DOM with a regexp, I am writing tiny script that fixes the indentation.
 
     
    