Daniel Finnie
12/8/2006 3:47:00 AM
Why are you doing a gsub but then anchoring the Regexp to the start &
ends? Use a normal sub or take out all the ^s and $s (except for the
character class definitions, i.e., the ones in square brackets).
Please post some sample text, not of what you would like to remove but
of what you would like to remove it from.
Dan
rpheath wrote:
> I'm trying to write a regular expression to replace a <pre>...</pre>
> block or a <blockquote><p>...</p></blockquote> block with a blank ('').
> I can only get the <pre>...</pre> to work correctly. Here's what I
> have:
>
> text.gsub(/^<pre>[^<]*<\/pre>$|^<blockquote><p>(.*?)<\/p><\/blockquote>$/,'')
>
> Can someone help me figure out why the blockquote is still showing
> up??? Thanks in advance.
>
>
>