spz1st has asked for the wisdom of the Perl Monks concerning the following question:
I need to split a string on the pattern of '),(', but have not been successful so far.
I've tried several other ways I can think of, but all failed.$str = '(1,"(text)", 123),(2,"(string)", 234),(...)'; @arr = split(/),(/, $str); # fail @arr = split(/\),\(/, $str); # fail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split on the pattern of '),('
by kennethk (Abbot) on Jun 07, 2012 at 19:47 UTC | |
|
Re: split on the pattern of '),('
by snape (Pilgrim) on Jun 07, 2012 at 20:13 UTC | |
|
Re: split on the pattern of '),('
by ikegami (Patriarch) on Jun 07, 2012 at 21:23 UTC | |
by tobyink (Canon) on Jun 08, 2012 at 07:17 UTC | |
by ikegami (Patriarch) on Sep 17, 2012 at 18:17 UTC | |
by tobyink (Canon) on Sep 17, 2012 at 19:08 UTC | |
by ikegami (Patriarch) on Sep 30, 2012 at 05:41 UTC | |
| |
|
Re: split on the pattern of '),('
by Anonymous Monk on Jun 07, 2012 at 19:36 UTC | |
by Anonymous Monk on Jun 07, 2012 at 20:06 UTC | |
|
Re: split on the pattern of '),('
by AnomalousMonk (Archbishop) on Jun 08, 2012 at 07:39 UTC |