in reply to Re: split on the pattern of '),('
in thread split on the pattern of '),('
my $string = "(foo),(bar),(baz)"; my @parts = split m{ [)] [,] [(] }x, $string; print "GOT: $_\n" for @parts;
Instead of m{ [)] [,] [(] }x you could use m{ \) , \( }x ... whichever you think is most readable. Either way, try to avoid the appearance of a million toothpicks standing on end.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: split on the pattern of '),('
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 | |
by tobyink (Canon) on Sep 30, 2012 at 08:13 UTC | |
by ikegami (Patriarch) on Sep 30, 2012 at 22:05 UTC |