I have some text like
<br />
blah
<br />
blah blah
Which im trying to change to:
<p>
blah
</p>
<p>
blah blah
</p>
I have the following regex
newContent = re.sub("<br />(?=(.*(<br />)?\n)<br />)","<p>",newContent)
But this isn't going to work how I want. I want anything before the look forward to be replaced with <p>
and after the look forward to be replaced with </p>
Is this possible?
(.*?)(?=
|$)`, replace with `
\1
` – HamZa Oct 25 '13 at 14:06