> 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 long time ago done in a one-liner using eval.
Anyone remember that?
_
$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
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
-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
> -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
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
> -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
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
>
>
> string
> - - -
> one two three four five six seven
>
> should be split
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
-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 split to
- - -
one
two
thre
-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
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(/
12 matches
Mail list logo