I have an HTML structure that is being pulled from an RSS feed, and I need to remove part of it, but it is not a standalone part of the stream.
So I have
<p>Some Html... </p>
<br />
<p>The p section I want to remove</p>
Is there a regex pattern that can do this? find the last <p> segment of a given string and chop it out? I am using C# for the Regex.
Are you sure you want to use Regex for this? Actually I think that you should use them only when you need to.
Why don’t you consider something like (assuming the HTML is well formed and that there are not nested paragraphs):
Alternatively you could consider using something more advanced (and maybe appropriate) like HTML Agility Pack or (worse if you are working with bad formed html) the integrated .NET XML parser (EDIT: As svicks says if you choose this solution please make sure that you are working with HTML that is also valid XML).