Re: split regex



Hi John,

I tried like this, where $line='*Options=-a"hello" -mt -ml3 -i"dir1\dir2"
-k -p -i"dir3\dir4" -m'*



if (grep/^Options/,$line)
{

@inc=split(/-i/,$line);

foreach $word (@inc)
{
print "$word\n";
}



I do not know how to proceed after this.....


Thanks for your quick reply...



Thanks
Umesh




On 12/15/05, John Doe <security.department@xxxxxxxx> wrote:
>
> Umesh T G am Donnerstag, 15. Dezember 2005 13.00:
> > Hi List,
>
> Hi Umesh
>
> > I want to get that value of *-i* set in below line.
> >
> > *Options=-a"hello" -mt -ml3 -i"dir1\dir2" -k -p -i"dir3\dir4" -m*
> >
> > What is the best way to get the value of *-i* values into one
> array. For
> > ex: I want the output as: *dir1\dir2* and *dir3\dir4* into one
> array.
>
> What possibilities did you try (show us some code), from which the best
> could be choosed, or to which a better could be added?
>
> joe
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
> For additional commands, e-mail: beginners-help@xxxxxxxx
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>
>


Relevant Pages

  • Re: split regex
    ... my grep return the values correct to my array and the values in array will ... > Hi Umesh ... > perldoc -f grep ...
    (perl.beginners)
  • Re: split regex
    ... Umesh T G am Donnerstag, ... perldoc -f grep ... directly into an array by catching the parts you like ... greetings joe ...
    (perl.beginners)
  • Re: split regex
    ... Sorry for that John. ... Umesh ... >>> my grep return the values correct to my array and the values in array ... Prev by Date: ...
    (perl.beginners)
  • Re: Extracting arrays
    ... Umesh wrote: ... "Consideration shall be given to the need for as many as 32 characters ... in some alphabets" - X3.4, ...
    (comp.lang.c)
  • Re: Deleting Array Element
    ... Umesh wrote: ... The space taken up by the array would still be the ... general problem. ...
    (comp.lang.c)