How can I insert content between the 2nd and 3rd paragraphs in HTML, using Perl?

Posted by Bob on Stack Overflow See other posts from Stack Overflow or by Bob
Published on 2010-04-28T16:48:28Z Indexed on 2010/04/29 16:57 UTC
Read the original article Hit count: 197

Filed under:

I'm trying to match the point between 2nd and 3rd paragraphs to insert some content. Paragraphs are delimited either by <p> or 2 newlines, mixed. Here's an example:

text text text text
text text text text

<p>
text text text text
text text text text
</p>
<--------------------------- want to insert text here
<p>
text text text text
text text text text
</p>

© Stack Overflow or respective owner

Related posts about perl