<p>I need to match and remove all tags using a regular expression in Perl.  I have the following:</p>

<pre><code>&lt;\\??(?!p).+?&gt;
</code></pre>

<p>But this still matches with the closing <code>&lt;/p&gt;</code> tag.  Any hint on how to match with the closing tag as well?</p>

<p>Note, this is being performed on xhtml.</p>

Assuming that this will work in PERL as it does in languages that claim to use PERL-compatible syntax:
```
/<\/?[^p][^>]*>/
```
EDIT:
But that won't match a
```
<pre>
```
or
```
<param>
```
tag, unfortunately.
This, perhaps?
```
```
/<\/?(?!p>|p )[^>]+>/
```
```
That should cover
```
<p>
```
tags that have attributes, too.