nwboy74 has asked for the wisdom of the Perl Monks concerning the following question:
Why does this match?
my $s = '<a href=\'2010-coachmen-mirada-bunk-house-w2-slides-for-sale- +TX-i111851\' class=\'uviss-rv_inventoryListMoreInfoLink\'>'; if ($s =~ /href=(['"])([^\1>]+?for-sale[^\1>]+?)\1>/i) { print "$2\n"; }
Doesn't [^\1>]+? mean look for a sequence of characters not containing \1 or >? I get this result:
2010-coachmen-mirada-bunk-house-w2-slides-for-sale-TX-i111851' class='uviss-rv_inventoryListMoreInfoLink
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Pattern Matching
by AnomalousMonk (Archbishop) on Jan 14, 2010 at 21:32 UTC | |
|
Re: Pattern Matching
by ahmad (Hermit) on Jan 14, 2010 at 21:22 UTC | |
by Anonymous Monk on Jan 14, 2010 at 21:46 UTC |