Re: split regex
- From: shawn.corey@xxxxxxxxxxxx (Shawn Corey)
- Date: Thu, 15 Dec 2005 09:39:16 -0500
Umesh T G wrote:
Hi Joe,
just to correct my prevoius one, my $line does not have * in the begining, that was a type. the $line value is like this
*Options=-a"hello" -mt -ml3 -i"dir1\dir2"-k -p -i"dir3\dir4" -m*
my grep return the values correct to my array and the values in array will be like this obviously:
*Options=-a"hello" -mt -ml3 * *"dir1\dir2"-k -p * *"dir3\dir4" -m* ** ** But, what I'm interested in getting the output values are: *"dir1\dir2"* *"dir3\dir4"*
I do not know how to get them......can u suggest pls.?
thanks Umesh
#!/usr/bin/perl
use strict; use warnings;
my $line='Options=-a"hello" -mt -ml3 -i"dir1\dir2" -k -p -i"dir3\dir4" -m';
for ( split /\s+/, $line ){
if( /^-i(.*)/ ){
print "$1\n";
}
}__END__
--
Just my 0.00000002 million dollars worth, --- Shawn
"Probability is now one. Any problems that are left are your own." SS Heart of Gold, _The Hitchhiker's Guide to the Galaxy_ .
- References:
- split regex
- From: Umesh T G
- Re: split regex
- From: John Doe
- Re: split regex
- From: Umesh T G
- Re: split regex
- From: John Doe
- Re: split regex
- From: Umesh T G
- split regex
- Prev by Date: Re: split regex
- Next by Date: maximum outgoing connections
- Previous by thread: Re: split regex
- Next by thread: Re: split regex
- Index(es):
Relevant Pages
|