in reply to Regex to match first html tag previous to text
I'd use HTML::TreeBuilder::XPath to find the nodes in question, then alter the values in the "DOM" and use methods from HTML::Tree to write the document back out.
Regular expressions are a very fragile solution to the "how do I parse HTML" problem.
-David
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Regex to match first html tag previous to text
by Greebo (Initiate) on Nov 30, 2007 at 17:09 UTC |
In Section
Seekers of Perl Wisdom