mosh has asked for the wisdom of the Perl Monks concerning the following question:
I have to locate from a large amount of lines, the lines that starts with "iff", the problem is that there're also lines begins with "if".
I'm interested only in the Regex that seperates the two kinds.
In the code below I have to get "didn't catch you !!"
In the second part i have to get (with the same regex): "catch you !!"my $line = "Iff bla blabla bla..."; if ($line =~ /^If?/) #if ($line =~ /^If{1}/) { print "catch you !!\n"; } else{print "didn't catch you !!\n";}
Thanks,my $line = "If bla blabla bla..."; if ($line =~ /^If?/) #if ($line =~ /^If{1}/) { print "catch you !!\n"; } else{print "didn't catch you !!\n";}
Mosh.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: regex problem
by robartes (Priest) on Jun 08, 2005 at 09:41 UTC | |
by rev_1318 (Chaplain) on Jun 08, 2005 at 10:20 UTC | |
by mosh (Scribe) on Jun 08, 2005 at 09:59 UTC | |
Re: regex problem
by inman (Curate) on Jun 08, 2005 at 10:33 UTC | |
Re: regex problem
by tlm (Prior) on Jun 08, 2005 at 12:19 UTC | |
by monarch (Priest) on Jun 08, 2005 at 12:54 UTC | |
Re: regex problem
by muntfish (Chaplain) on Jun 08, 2005 at 09:40 UTC | |
Re: regex problem
by tchatzi (Acolyte) on Jun 08, 2005 at 09:59 UTC | |
by monarch (Priest) on Jun 08, 2005 at 12:55 UTC | |
Re: regex problem
by murugu (Curate) on Jun 08, 2005 at 10:01 UTC |