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’m trying

Re: split regex

2015-03-20 Thread Shlomi Fish
Hi Danny, On Thu, 19 Mar 2015 21:42:53 + Danny Wong (dannwong) dannw...@cisco.com 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

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

Re: split regex

2015-03-19 Thread Danny Wong (dannwong)
@perl.orgmailto:beginners@perl.org Subject: split regex 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

split regex

2005-12-15 Thread Umesh T G
Hi List, I want to get that value of *-i* set in below line. *Options=-ahello -mt -ml3 -idir1\dir2 -k -p -idir3\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.

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=-ahello -mt -ml3 -idir1\dir2 -k -p -idir3\dir4 -m* What is the best way to get the value of *-i* values into one array. For ex: I want the output as:

Re: split regex

2005-12-15 Thread Umesh T G
Hi John, I tried like this, where $line='*Options=-ahello -mt -ml3 -idir1\dir2 -k -p -idir3\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

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=-ahello -mt -ml3 -idir1\dir2 -k -p -idir3\dir4 -m'* if (grep/^Options/,$line) { @inc=split(/-i/,$line); foreach $word (@inc) { print $word\n; } I do not know how to

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=-ahello -mt -ml3 -idir1\dir2-k -p -idir3\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 Shawn Corey
Umesh T G wrote: I tried like this, where $line='*Options=-ahello -mt -ml3 -idir1\dir2 -k -p -idir3\dir4 -m'* This line won't compile. Which of the following is it? $line='Options=-ahello -mt -ml3 -idir1\dir2 -k -p -idir3\dir4 -m'; $line='*Options=-ahello -mt -ml3 -idir1\dir2 -k -p

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=-ahello -mt -ml3 -idir1\dir2-k -p -idir3\dir4 -m* my grep return the values correct to my array and the values in array will be like

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=-ahello -mt -ml3 -idir1\dir2-k -p -idir3\dir4 -m* my grep return the values correct to my array

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=-ahello -mt -ml3 -idir1\dir2-k -p -idir3\dir4\ -m -n -i\dir5\dir6 -k* ** then, I'm getting output like this, dir1\dir2

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