Found it....because I used the ($p) which catchs first he whole string, and then the second string (20) Thanks Chanan
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Chanan Berler Sent: Thursday, January 01, 2009 6:12 PM To: 'Perl in Israel' Subject: Re: [Israel.pm] FW: What's wrong with the parsing....? Think this was my problem :-$ But still why didn't I catch only the 20? Thanks again Chanan -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Avishalom Shalit Sent: Thursday, January 01, 2009 5:52 PM To: Perl in Israel Subject: Re: [Israel.pm] FW: What's wrong with the parsing....? is the @ls $ls another spelling mistake ? also you could drop the .*? at the begining , it adds nothing to the pattern 2009/1/1 bc.other <[email protected]>: > Please ignore the misspelling mistake on the pattrn (should be > pattern)....but still it doesn't work for me. > :-) > Chanan > > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf > Of Chanan Berler > Sent: Thursday, January 01, 2009 5:43 PM > To: 'Perl in Israel' > Subject: [Israel.pm] FW: What's wrong with the parsing....? > > Hello All, > > I tried to do the following, and retrieve the 20 as a value: > > $pattern = '.*?Instances=(\d+)'; > $str = 'Network traffic is Instances=20 bytes'; > > @ls = $str =~ m/($pattrn)/g; > > print $ls; > > > but it didn't work for me. > Thanks > Chanan > > _______________________________________________ > Perl mailing list > [email protected] > http://perl.org.il/mailman/listinfo/perl > > _______________________________________________ > Perl mailing list > [email protected] > http://perl.org.il/mailman/listinfo/perl > -- -- vish _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl _______________________________________________ Perl mailing list [email protected] http://perl.org.il/mailman/listinfo/perl
