Rich36 has asked for the wisdom of the Perl Monks concerning the following question:
What's the best way to split a string and keep the delimiter as part of the string? I know that I could split the string into array elements, then use map on the array to add the delimiter back, but I wasn't sure if there's a better, simpler way.
I'm looking at data sort of like this:
:TAG:This is just some text. blahblahblahblahblahblahblah blahblahblah +. blahblah? blah.:TAG:This is just some text. blahblahblahblahblahbl +ahblah blahblahblah. blahblah? blah. :TAG:This is just some text. bl +ahblahblahblahblahblahblah blahblahblah. blahblah? blah. :TAG:This i +s just some more text. blahblahblahblahblahblahblah blahblahblah. bla +hblah? blah.
Where :TAG: is the delimiter.
Thanks,
Rich36
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Splitting and maintaining the delimiter
by boo_radley (Parson) on May 23, 2002 at 16:12 UTC | |
|
Re: Splitting and maintaining the delimiter
by Joost (Canon) on May 23, 2002 at 16:11 UTC | |
by Preceptor (Deacon) on Mar 07, 2007 at 10:52 UTC | |
|
Re: Splitting and maintaining the delimiter
by Molt (Chaplain) on May 23, 2002 at 15:46 UTC | |
by Rich36 (Chaplain) on May 23, 2002 at 16:00 UTC | |
|
Re: Splitting and maintaining the delimiter
by rbc (Curate) on May 23, 2002 at 21:25 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |