Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi folks,
I have data with three delimiters, call them : % and ; The data look like this: xyz:yy;zz%foo:bar
I would like to split each line a la:
split /:|%|;/But I would also like to obtain the delimiter, so that I have two arrays, the data, xyz,yy,zz,foo,bar and the delimiters :,;,%,:
Thanks for any suggestions!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Split at multiple delimiters and get the delimiter
by kennethk (Abbot) on Mar 01, 2011 at 21:27 UTC | |
|
Re: Split at multiple delimiters and get the delimiter
by jeffa (Bishop) on Mar 01, 2011 at 21:27 UTC | |
|
Re: Split at multiple delimiters and get the delimiter
by eff_i_g (Curate) on Mar 01, 2011 at 21:32 UTC |