Regexp to enclose text with P-tag

From: Andreas N (andreas_at_easywebsite.se)
Date: 05/18/04


Date: 18 May 2004 15:08:28 +0200


I'm looking for help writing a regexp to enclose text with a <p> tag.
The rule is that other HTML tags in the text like <img> and other
block elements should NOT be enclosed by <p>.
example:

lorem ipsum <img src="image.gif" />dolor

should become:

<p>lorem ipsum</p><img src="image.gif" /><p>dolor</p>

Can anyone help me with this? :)



Relevant Pages

  • Regexp to enclose text with P-tag
    ... I'm looking for help writing a regexp to enclose text with a tag. ... The rule is that other HTML tags in the text like and other ...
    (comp.lang.python)
  • Regexp to enclose text with P-tag
    ... I'm looking for help writing a regexp to enclose text with a tag. ... The rule is that other HTML tags in the text like and other ...
    (comp.lang.python)