Do not use regular expressions to parse HTML or XML.
use warnings; use strict; use Mojo::DOM; my $dom = Mojo::DOM->new(<<'HTML'); <div id="taglines_content" class="header"> <div class="header"> <div class="nav"> <div class="desc">Showing all 3 taglines</div> </div> </div> <div class="soda odd">Power. Grace. Wisdom. Wonder.</div> <div class="soda even">Wonder. Power. Courage.</div> <div class="soda odd">The future of justice begins with her</div> </div> HTML $dom->find('.soda')->each(sub { print "$_\n" }); __END__ <div class="soda odd">Power. Grace. Wisdom. Wonder.</div> <div class="soda even">Wonder. Power. Courage.</div> <div class="soda odd">The future of justice begins with her</div>
In reply to Re: I match a pattern in regex, yet I don't get the group I wanted to extract for some reason
by haukex
in thread I match a pattern in regex, yet I don't get the group I wanted to extract for some reason
by SergioQ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |