in reply to Iteration condition...
Is a single valid html tag. To accurately describe and manipulate html with regular expressions, one would want something like:$html_tag = '<img src="img.png" alt="peg leg > with a kickstand">';
Which could be packaged as an iterator.my $x = SOME_HTML; while($x =~ /\G(.*?)(<(?:"[^"]*"|'[^']*'|[^'">])*>)/gcs){ do_something_with_text($1); do_something_with_tag($2); }
|
|---|