vit has asked for the wisdom of the Perl Monks concerning the following question:
I want to collect all occurencies of $ppc_pat when after some set of symbols it is concluded with $ppc_pat_2. I thought if I put .+? this will serve my purpose. But it does not work.my $ppc_pat = qr/<bidListing\sbidId=\"\d+\"/; my $ppc_pat_2 = qr/<\/bidListing/; my (@ar) = $xml =~ /($ppc_pat).+?$ppc_pat_2/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Non- greedy regex question
by state-o-dis-array (Hermit) on Dec 02, 2010 at 23:03 UTC | |
by yuvanbala (Initiate) on Dec 03, 2010 at 06:49 UTC |