Re: split regex

2015-03-21 Thread Brandon McCaig
Danny Wong: Hello, On Thu, Mar 19, 2015 at 09:25:02PM +, Danny Wong (dannwong) wrote: > Hi Perl GURU, I have a string like this: > > 'Baseline: (_bMgvUBQ_EeKsP6DECdq0Lg) 1 "Initial Baseline" > "Initial Baseline of Component NGP-Diagnostics" Sivakumar Subas > Oct 12, 2012 12:35:41 AM'; > > I

Re: split regex

2015-03-20 Thread Shlomi Fish
Hi Danny, On Thu, 19 Mar 2015 21:42:53 + "Danny Wong (dannwong)" wrote: > Nevermind. I used regex to accomplish what I wanted instead of the split > command. Thanks guys! > Just a note in general: sometimes when a simple split or a regex match fails you may opt to employ more complex pars

Re: split regex

2015-03-19 Thread Danny Wong (dannwong)
Nevermind. I used regex to accomplish what I wanted instead of the split command. Thanks guys! From: Danny H Wong mailto:dannw...@cisco.com>> Date: Thursday, March 19, 2015 at 2:25 PM To: Perl List mailto:beginners@perl.org>>, Perl Beginners mailto:beginners@perl.org>> Subjec

split regex

2015-03-19 Thread Danny Wong (dannwong)
Hi Perl GURU, I have a string like this: 'Baseline: (_bMgvUBQ_EeKsP6DECdq0Lg) 1 "Initial Baseline" "Initial Baseline of Component NGP-Diagnostics" Sivakumar Subas Oct 12, 2012 12:35:41 AM'; I’m trying to perform a split via \s (spaces) delimiter, but this give me a partial return of "Initial Ba

Re: split regex

2005-12-15 Thread Umesh T G
Sorry for that John. It works fine. Many thanks for your help. Umesh On 12/16/05, Umesh T G <[EMAIL PROTECTED]> wrote: > > Thanks Very much John. :) it worked, but a small problem. if I have > "\" after the directory name, it does not take as new instanance. > for ex: > if my $line is*

Re: split regex

2005-12-15 Thread Umesh T G
Thanks Very much John. :) it worked, but a small problem. if I have "\" after the directory name, it does not take as new instanance. for ex: if my $line is*Options=-a"hello" -mt -ml3 -i"dir1\dir2"-k -p -i"dir3\dir4\" -m -n -i"\dir5\dir6" -k* ** then, I'm getting output like this, dir1\dir

Re: split regex

2005-12-15 Thread John Doe
Umesh T G am Donnerstag, 15. Dezember 2005 15.31: > 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

Re: split regex

2005-12-15 Thread Shawn Corey
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 l

Re: split regex

2005-12-15 Thread Shawn Corey
Umesh T G wrote: I tried like this, where $line='*Options=-a"hello" -mt -ml3 -i"dir1\dir2" -k -p -i"dir3\dir4" -m'* This line won't compile. Which of the following is it? $line='Options=-a"hello" -mt -ml3 -i"dir1\dir2" -k -p -i"dir3\dir4" -m'; $line='*Options=-a"hello" -mt -ml3 -i"dir1\dir

Re: split regex

2005-12-15 Thread Umesh T G
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:

Re: split regex

2005-12-15 Thread John Doe
Umesh T G am Donnerstag, 15. Dezember 2005 14.20: > Hi John, Hi Umesh > 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"; > } > >

Re: split regex

2005-12-15 Thread Umesh T G
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... Thank

Re: split regex

2005-12-15 Thread John Doe
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

split regex

2005-12-15 Thread Umesh T G
Hi List, 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. Thanks in advance.