Quote:
Originally Posted by ignaz wrangel
the regex I posted produces that, it selects the marker and the following opening <p>, and replaces the lot with <p class="scenebreak">, the rest just remains in place ("some paragraph text</p>")
|
You do have a bug in your regex.
<p><br /></p>[^<]*<p\b[^>]*> <---incorrect
<p><br /></p>[^<]*<p> <---correct
You do not want to replace the following <p> willy nilly if hit has a class. You want to only replace the br line and the p only if the <p> is just a plain <p>. If it has a class and you want to replace the p and the class, run the regex again specifying the specific class. Then you can see if you have any more br lines left and how you want to deal with them.