RE: Split function in Perl

2005-07-26 Thread Peter Eisengrein
> I have a problem with the split function. > > > string > - - - > one "two three" "four five" six seven > > should be split to > - - - > one > two three > four five > six > seven > I seem to recall seeing this a l

Re: Split function in Perl

2005-07-26 Thread Michael Louie Loria
$Bill Luebkert wrote: > Michael Louie Loria wrote: > > >>I'm tesing the Text::ParseWords >> >>I'm new in Perl and I'm a little bit confused with the PATTERNS >>option but I'm learning it. >> >>Is this code good for checking valid date in the format -MM-DD? >>or do you have any other suggestio

Re: Split function in Perl

2005-07-26 Thread $Bill Luebkert
Michael Louie Loria wrote: > I'm tesing the Text::ParseWords > > I'm new in Perl and I'm a little bit confused with the PATTERNS > option but I'm learning it. > > Is this code good for checking valid date in the format -MM-DD? > or do you have any other suggestions What's with the ~'s start

RE: Split function in Perl

2005-07-26 Thread Michael Louie Loria
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Thanks for all the replies. I'm tesing the Text::ParseWords I'm new in Perl and I'm a little bit confused with the PATTERNS option but I'm learning it. Is this code good for checking valid date in the format -MM-DD? or do you have any other su

RE: Split function in Perl

2005-07-26 Thread robert
> -Original Message- > From: $Bill Luebkert > Sent: Monday, July 25, 2005 11:42 PM > > robert wrote: > > >>s/"([^"]+) ([^"]+)"/$1\000$2/g; > > > > holy cow. can you explain that substitution? my brain just about > > popped. > > It's just replacing the blank/space between two w

Re: Split function in Perl

2005-07-26 Thread $Bill Luebkert
robert wrote: >>s/"([^"]+) ([^"]+)"/$1\000$2/g; > > holy cow. can you explain that substitution? my brain just about > popped. It's just replacing the blank/space between two words with a binary 0 and losing the quotes. Lyle didn't like that one cause it didn't handle mult spaces. He

RE: Split function in Perl

2005-07-25 Thread robert
> -Original Message- > From: $Bill Luebkert > Sent: Monday, July 25, 2005 9:30 PM > > s/"([^"]+) ([^"]+)"/$1\000$2/g; holy cow. can you explain that substitution? my brain just about popped. > > my @a = split / +/; > > foreach (@a) { > s/\000/ /g; # restore e

Re: Split function in Perl

2005-07-25 Thread $Bill Luebkert
Michael Louie Loria wrote: > Hello, > > I have a problem with the split function. > > string > - - - > one "two three" "four five" six seven > > should be split to > - - - > one > two three > four five > six > seven > &g

RE: Split function in Perl

2005-07-25 Thread Darrell Gammill
http://search.cpan.org/~nwclark/perl-5.8.7/lib/Text/ParseWords.pm -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Michael Louie Loria Sent: Monday, July 25, 2005 9:57 PM To: perl-win32-users@listserv.ActiveState.com Subject: Split function in Perl

Split function in Perl

2005-07-25 Thread Michael Louie Loria
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hello, I have a problem with the split function. string - - - one "two three" "four five" six seven should be split to - - - one two three four five six seven string - - - one two three four five six seven should be sp

RE: a question for split function in perl

2004-12-01 Thread Moon, John
-Original Message- From: Ella Cai [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 01, 2004 4:16 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: a question for split function in perl   Our codes is like this:   $line = "fordGID=54097"; ($m

RE: a question for split function in perl

2004-12-01 Thread Gardner, Sam
Title: RE: a question for split function in perl pretty easy. . . Just add the colon to the character class. . . $line = "fordGID=54097"; $line2 = "fordGID:54097"; ($match,$data)=split(/[=:]/,$line); print "line 1 is $match, $data"; ($match,$data)=split(/

Re: Use of "split" function...

2003-06-10 Thread Carl Jolley
On Mon, 9 Jun 2003, Zbynek Houska wrote: > dear all, > > I wonder how to initialize and use "split" function in this case: > > here are some datas (stored in file): > > 28.10.2002 06:47 Almighty - Just add life > 28.10.2002 06:47

Re: Split function

2002-07-15 Thread Ron Grabowski
> Would it be only semantic to escape the semicolon, or could it cause a > problem not to do so? I'm not asking to be picky, I really don't know. :) The semi-colon is not special unless you do something like this: m;foo|bar|\;; ___ Perl-Win32-Users ma

Re: Split function

2002-07-15 Thread $Bill Luebkert
Mangesh Paranjape wrote: > Forwarded on behalf of Moshe: > > I would like to know if this is OK? > > @array = split(/(--|;)/,$var); > > I would like to split on either a double dash or a semi colon with one > split using ( | ). > > Is that viable, or do I have to test for either one, and spli

RE: Split function

2002-07-15 Thread Scot Robnett
15, 2002 1:20 PM To: [EMAIL PROTECTED] Subject: Re: Split function > I would like to split on either a double dash or a semi colon with one > split using ( | ). $_ = 'Hello-world;how--are--you;today'; print join "\n", split /--|;/;

Re: Split function

2002-07-15 Thread Ron Grabowski
> I would like to split on either a double dash or a semi colon with one > split using ( | ). $_ = 'Hello-world;how--are--you;today'; print join "\n", split /--|;/; ___ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.Act

Split function

2002-07-15 Thread Mangesh Paranjape
Forwarded on behalf of Moshe: I would like to know if this is OK? @array = split(/(--|;)/,$var); I would like to split on either a double dash or a semi colon with one split using ( | ). Is that viable, or do I have to test for either one, and split accordingly. Thanks. A friend of Mangesh  

Re: REGULAR EXPRESSION IN SPLIT FUNCTION - PLEASE HELP ME.

2001-03-02 Thread Sarir Khamsi
>>>>> "ponnambalam" == ponnambalam ma <[EMAIL PROTECTED]> writes: > DEAR FRIENDS, > PLEASE HELP ME REGARDING THE REGULAR EXPRESSION IN SPLIT FUNCTION > data is : CDM210909 or FDM210909 ( ie start with 3characters followed > any no of numeric n

Re: REGULAR EXPRESSION IN SPLIT FUNCTION - PLEASE HELP ME.

2001-03-01 Thread Ron Grabowski
From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> [ Grrr, just post to one list! ] > ($a,$b) = $x =~ /(.{3})(.*)/; Shouldn't you be pushing that stuff into an arra