As I have answered in HTML-and-regex questions here so many times before, the use of regex will not allow you to consume HTML.
Regex is not a tool that can be used to correctly parse HTML.
NET Framework and specifically talks about Consider[ing] the Input Source.
Regular Expressions do have limitations, but have you considered the following? NET framework is unique when it comes to regular expressions in that it supports Balancing Group Definitions. NET Regular Expression Engine As described above properly balanced constructs cannot be described by a regular expression. NET regular expression engine provides a few constructs that allow balanced constructs to be recognized. NET regular expression to emulate a restricted PDA by essentially allowing simple versions of the stack operations: push, pop and empty.
Even Jon Skeet cannot parse HTML using regular expressions.If you need this for PHP: The PHP DOM functions won't work properly unless it is properly formatted XML.No matter how much better their use is for the rest of mankind.HTML-plus-regexp will liquify the nerves of the sentient whilst you observe, your psyche withering in the onslaught of horror.Rege̿̔̉x-based HTML parsers are the cancer that is killing Stack Overflow it is too late it is too late we cannot be saved the trangession of a chi͡ld ensures regex will consume all living tissue (except for HTML which it cannot, as previously prophesied) dear lord help us how can anyone survive this scourge using regex to parse HTML has doomed humanity to an eternity of dread torture and security holes using regex as a tool to process HTML establishes a breach between this world and the dread realm of c͒ͪo͛ͫrrupt entities (like SGML entities, but more corrupt) a mere glimpse of the world of regex parsers for HTML will instantly transport a programmer's consciousness into a world of ceaseless screaming, he comesithy regex-infection will devour your HTML parser, application and existence for all time like Visual Basic only worse he comes he comes do not fight he com̡e̶s, ̕h̵is un̨ho͞ly radiańcé destro҉ying all enli̍̈́̂̈́ghtenment, HTML tags lea͠ki̧n͘g fr̶ǫm ̡yo͟ur eye͢s̸ ̛l̕ik͏e liquid pain, the song of re̸gular expre Moderator's Note This post is locked to prevent inappropriate edits to its content. If you have a small set of HTML pages that you want to scrape data from and then stuff into a database, regexes might work fine.