Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Re: Re: Splitting a comma-delimited string where a substring could countain commas

by I0 (Priest)
on May 03, 2002 at 21:53 UTC ( #163933=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Splitting a comma-delimited string where a substring could countain commas
in thread Splitting a comma-delimited string where a substring could contain commas

local $_ = "this, (that, those), these ((not enough, (nope)), never), +there"; (my $re=$_)=~s/((\()|(\))|.)/${[')','']}[!$3]\Q$1\E${['(','']}[!$2]/gs +; $re= join'|',map{quotemeta}eval{/$re/}; die $@ if $@ =~ /unmatched/; while( /((?:$re|[^,])*)/g ){ print "$1\n"; }


Comment on Re: Re: Re: Splitting a comma-delimited string where a substring could countain commas
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://163933]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (16)
As of 2014-09-19 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (142 votes), past polls