Re: help with a regex and greediness

2004-03-14 Thread Stuart White
--- "R. Joseph Newton" <[EMAIL PROTECTED]> wrote: > Stuart White wrote: > I don't think so: > ... > The only place a colon split splits is where you > have a colon. > That was MY typo. Oops. In the book there is a colon after merlyn, not a question mark. Irrespective of that, I was still

Re: help with a regex and greediness

2004-03-14 Thread Stuart White
--- "R. Joseph Newton" <[EMAIL PROTECTED]> wrote: > Stuart White wrote: > > > > the file format is not sloppy at all. I was just > > confused as to why I couldn't use split on the > first > > space score comma and space, and then the next > space > > score. <-Perhaps I just answered my questio

Re: help with a regex and greediness

2004-03-13 Thread R. Joseph Newton
Stuart White wrote: > the file format is not sloppy at all. I was just > confused as to why I couldn't use split on the first > space score comma and space, and then the next space > score. <-Perhaps I just answered my question right > there, seeing that in the second iteration, there is > no c

Re: help with a regex and greediness

2004-03-13 Thread R. Joseph Newton
Stuart White wrote: > $line = > "merlyn::118:10:Randal:/home/merlyn?/usr/bin/perl"; > @fields = s;oit(/:/,$line); > #now @fields is ("merlyn:, > "","118","10","Randal","/home/merlyn","/usr/bin/perl") I don't think so: Greetings! E:\d_drive\perlStuff>perl -w $line = "merlyn::118:10:Randal:/ho

Re: help with a regex and greediness

2004-03-13 Thread Stuart White
--- Paul Johnson <[EMAIL PROTECTED]> wrote: > > Stuart White said: > > > I'm not sure what's going wrong here. Can someone > > tell me how I can split 'Spurs 94, Suns 82' into: > > array[0] == 'Spurs' and array[1] == 'Suns' > > @array = /([[:alpha:]]+)/g; > This did what I wanted it to do, t

Re: help with a regex and greediness

2004-03-13 Thread Stuart White
--- "R. Joseph Newton" <[EMAIL PROTECTED]> wrote: > Stuart White wrote: > > > Wow, yeah that helps a lot. > > Here's a question: If if had: > > $line = 'Spurs 94, Suns 82, Heat 99, Magic 74' > > and then did a split on comma and comma's > surrounding > > spaces: > > @result = split (/\s*,\s*/, $

Re: help with a regex and greediness

2004-03-12 Thread R. Joseph Newton
Stuart White wrote: > Wow, yeah that helps a lot. > Here's a question: If if had: > $line = 'Spurs 94, Suns 82, Heat 99, Magic 74' > and then did a split on comma and comma's surrounding > spaces: > @result = split (/\s*,\s*/, $line); result? How specific is "result" to the issue at hand? Woul

Re: help with a regex and greediness

2004-03-12 Thread Stuart White
--- "Randy W. Sims" <[EMAIL PROTECTED]> wrote: > On 03/12/04 08:18, Stuart White wrote: > > I like the idea of using split() but decided to > keep > > most of my regex and incorporate split on the > string. > > So the string: 'Spurs 94, Suns 82' <-and there may > or > > may not be a space after th

Re: help with a regex and greediness

2004-03-12 Thread Randy W. Sims
On 03/12/04 08:18, Stuart White wrote: I like the idea of using split() but decided to keep most of my regex and incorporate split on the string. So the string: 'Spurs 94, Suns 82' <-and there may or may not be a space after the 2. I decided to read up on split(), and then try to split it. The spli

Re: help with a regex and greediness

2004-03-12 Thread Paul Johnson
Stuart White said: > I'm not sure what's going wrong here. Can someone > tell me how I can split 'Spurs 94, Suns 82' into: > array[0] == 'Spurs' and array[1] == 'Suns' @array = /([[:alpha:]]+)/g; -- Paul Johnson - [EMAIL PROTECTED] http://www.pjcj.net -- To unsubscribe, e-mail: [EMAIL PROT

Re: help with a regex and greediness

2004-03-12 Thread Stuart White
I like the idea of using split() but decided to keep most of my regex and incorporate split on the string. So the string: 'Spurs 94, Suns 82' <-and there may or may not be a space after the 2. I decided to read up on split(), and then try to split it. This is what I came up with: @teamscores = spl

Re: help with a regex and greediness

2004-03-11 Thread Stuart White
Oops, it just looked like you were testing a literal. My mistake, I'll check it out. --- "Randy W. Sims" <[EMAIL PROTECTED]> wrote: > On 3/11/2004 10:28 PM, Stuart White wrote: > > > --- "Randy W. Sims" <[EMAIL PROTECTED]> > > wrote: > > > >>On 3/11/2004 9:01 PM, Stuart White wrote: > >> > >>

Re: help with a regex and greediness

2004-03-11 Thread Randy W. Sims
On 3/11/2004 10:28 PM, Stuart White wrote: --- "Randy W. Sims" <[EMAIL PROTECTED]> wrote: On 3/11/2004 9:01 PM, Stuart White wrote: I'm confused about greediness. This is the line that I'm trying to match: Spurs 94, Suns 82 If the line is as above, I probably wouldn't use a regex. The following

Re: help with a regex and greediness

2004-03-11 Thread Stuart White
--- "Randy W. Sims" <[EMAIL PROTECTED]> wrote: > On 3/11/2004 9:01 PM, Stuart White wrote: > > > I'm confused about greediness. > > This is the line that I'm trying to match: > > > > Spurs 94, Suns 82 > > If the line is as above, I probably wouldn't use a > regex. The following > is more verbo

Re: help with a regex and greediness

2004-03-11 Thread Randy W. Sims
On 3/11/2004 9:01 PM, Stuart White wrote: I'm confused about greediness. This is the line that I'm trying to match: Spurs 94, Suns 82 If the line is as above, I probably wouldn't use a regex. The following is more verbose, but easier to manage IMHO. #!/usr/bin/perl use strict; use warnings; my

help with a regex and greediness

2004-03-11 Thread Stuart White
I'm confused about greediness. This is the line that I'm trying to match: Spurs 94, Suns 82 This is my regex: if ($_ =~/(Spurs|Suns|Mavericks|Lakers|Clippers|Cavaliers|Celtics|Pacers|Pistons|Wizards|Warriors|Bulls|Hawks|Raptors|Magic|Heat|Kings|Rockets|Nuggets|Grizzlies|Jazz|Knicks|Nets|Supersoni