in reply to Parsing nested HTML with just regex

Use HTML::Parser. Do not use a regex. HTML::Parser will do everything you want, it'll continue to work when your HTML changes or is malformed, and it's been tested in thousands of different situations. In addition, it's maintained for free by someone other than you (which leaves more time for you to work on your real problems, not parsing).

------
We are the carpenters and bricklayers of the Information Age.

Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

  • Comment on Re: Parsing nested HTML with just regex