Re: regexp needed

2004-06-22 Thread Gunnar Hjalmarsson
Jorge Goncalves wrote: Hi List , I have this to print: 1 2 3 with this script but it didn't work: No, it does not even compile. :( while ($file =~ /^\s+(\d+).(.+)$/) { You always need the /g modifier when using the m// operator that way in a while loop. In this case you also need the /m modif

RE: regexp needed

2004-06-22 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Goncalves, Jorge (Ext) wrote: > Hi List , I have this to print: > 1 > 2 > 3 > > with this script but it didn't work: > #!/usr/bin/perl > use strict; > use warnings; > > { > local $/; > my $file = ; > while ($file =~ /^\s+(\d+).(.+)$/) { > print $1\n if $2 =~ /extractStat/

Re: Regexp needed

2002-05-23 Thread Sudarsan Raghavan
Jorge Goncalvez wrote: > Hi, i have this: > open INFILE, "< $_Globals{SYSLOG}" or die $!; > #ModifiedFile(); > while () { > if (/([0-9a-z:]+)\s*via eth0)/) { > $_Globals{MAC_ADDR} = $1; >} > } > And my file is like this: > . > LOG_INFO :

Re: regexp needed

2002-05-14 Thread drieux
On Tuesday, May 14, 2002, at 06:16 , Jorge Goncalvez wrote: [..] > > And I wanted to extract Guest (without the quotes)i tried this: that could be your problem - the /PATTERN/i - is for 'case insensitive' - hence would catch both DOG and dog or dOg [..] > > > It didn't worked why? What's wro

Re: regexp needed

2002-05-14 Thread Tor Hildrum
> Hi, I have a file like this: > ... > SceInfEveryone = "Everyone" > SceInfGuests = "Guests" > SceInfGuest = "Guest" > SceInfPowerUsers = "Power Users" > SceInfPrintOp = "Print Operators" > .. > > And I wanted to extract Guest (without the quotes)i tried this: > > my $HISEFILE= "c:/h

RE: Regexp needed

2002-03-05 Thread Jason Larson
> -Original Message- > From: Jorge Goncalvez [mailto:[EMAIL PROTECTED]] > Subject: re:Regexp needed > > > hi, i have this: > my ($Path) = $MountsPath =~ /(.+?)cygwin/; > but I wanted to get rid of the "/". > because $MountsPath could be c:/cygwin or c:/xyz/cygwin or > c:/xyz/zyx/cygwin