Trying to match tr
items that have a class
with either the first three letters starting with eve
or day
. This is my attempt:
my @stuff = $p->look_down(
_tag => 'tr',
class => 'qr/eve*|day*/g'
);
foreach (@stuff) {
print $_->as_text;
};
Just curious, what kind of objects are in @stuff
?
Is this OK? See below:
my @stuff = $p->look_down(
_tag => 'tr',
class => qr/eve.*|day.*/
);
print "\n\n";
foreach (@stuff) {
print $_->as_text . "\n\n";
};
You need to anchor your regex with
^
in order for the class to match the first three letters.The following achieves what you want:
Outputs: