in reply to Two Eclectic split()s
On a side note Method 1 returns the following (on AS 5.8):use Data::Dumper; my $string = '"I think" this fits "the \\"requirements presented\\" th +en" again \\"I could "be wrong"'; print Dumper [split /\s+(?=(?:(?:(?:[^"\\]|\\")*"){2})*(?:\\"|[^"])*$) +/, $string];
and Method 2: returns:"I think" this fits 1 1 again \"I could "be wrong"
I think this 1 1 requirements presented\ then again \ I could be wrong
split /\s+(?=(?:(?:[^"]*"){2})*[^"]*$)/,$string
-enlil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Two Eclectic split()s (another one maybe?)
by japhy (Canon) on May 21, 2003 at 14:18 UTC |