I'd like to replace <br/>s with a space when they're between opening and closing h1 tags. However, something simple such as
Code:
<h1>(.*?)<br/>(.*?)<h1/>
<h1>\1 \2<h1/>
doesn't work well since there are some opening and closing h1s that don't have a br between them, so this matches everything until the next br and then closing h1, which could be a lot. I just want to replace a br when it's between an opening and closing h1. In other words find an opening and closing h1 tag, then if there's a br in that range replace it with a space, otherwise do nothing.
How to?