in reply to p tag substitution

Do not use regexen to parse markup - life if just too short to bother reinventing that particular wheel. Use a suitable HTML module. See Re: Some portion of the text missing for example.


True laziness is hard work

Replies are listed 'Best First'.
Re^2: p tag substitution
by Anonymous Monk on Oct 15, 2009 at 08:30 UTC
    How to check if > exists after the  < and then substitute < with </p><p> For example :
    <a ahref="http://www.prospect.org/cs/articles?articleId=11945"> # Here < should not be replaced with </p><p>
      if ($code =~ /=~/ && $data =~ /<p>/) { print "Woe unto you!\n" }

      True laziness is hard work