Good point, Steve. Andy did actually say "start tags", though I
guessed that this was meant to include all tags, including end tags
and empty tags. If it should really only match start tags, then I
agree that adding "/" inside the first set of square brackets in
either of the expressions I suggested would accomplish this (the first
of which would then be almost identical to Steve's recommendation).
-Brandon 🙂
On Fri, Jun 11, 2010 at 9:33 AM, EXT-Thompson, Steve
<steve.thompson2@boeing.com> wrote:
> Your algorithm is wrong. What you have says "Remove any string starting with
> '<', ending with '>', and with any number of any character in between." What
> you want is "Remove any string starting with '<', ending with '>', and with
> any number of any character other than '>' or '/' in between."
>
> The '>' exclusion causes the removed string to stop at the first '>' it
> finds after starting at a '<'. The '/' exclusion causes only the removal of
> start tags, since any end tag will contain a '/'.
>
> Coding of the actual regex is left as an exercise for the student... 😄
>
> No, seriously, I believe you need something like "<[^/>]*>".
>
> Steve Thompson
> +1(316)977-0515