I want to get all HTML <p>...</p> in a document.
Using Regex to find all such strings using:
Regex regex = new Regex(@"\<p\>([^\>]*)\</p\>", RegexOptions.IgnoreCase);
But I am not able to get any result. Is there anything wrong with my regular expression.?
For now, I just want to get everything that comes in between <p>...</p> tags and want to use Regex for this as the source is not an HTML document.
DO NOT PARSE HTML USING Regular Expressions!!!
Instead, use the HTML Agility Pack.
For example:
EDIT: You can do this even if the document isn’t actually HTML.