perlpal has asked for the wisdom of the Perl Monks concerning the following question:
I need to split a string which has multiple repitititions of a pattern only on the first occurrence of the pattern.
Case in point being the string mentioned below :
Aggregate: f3050-184-160:EmptyAggr
I need to split the string on ":" on the first occurrence only i.e when it appears after Aggregate.
Is this possible via split in a single step or do i need to post-process the array after split.
Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Splitting on a pattern once
by almut (Canon) on Mar 03, 2010 at 18:19 UTC | |
|
Re: Splitting on a pattern once
by ikegami (Patriarch) on Mar 03, 2010 at 18:20 UTC | |
by ungalnanban (Pilgrim) on Mar 05, 2010 at 10:49 UTC | |
by kiruthika.bkite (Scribe) on Mar 18, 2010 at 10:47 UTC | |
by kiruthika.bkite (Scribe) on Mar 22, 2010 at 10:58 UTC | |
by ikegami (Patriarch) on Mar 05, 2010 at 17:31 UTC | |
by Anonymous Monk on Mar 18, 2010 at 11:04 UTC | |
|
Re: Splitting on a pattern once
by toolic (Bishop) on Mar 03, 2010 at 18:24 UTC | |
|
Re: Splitting on a pattern once
by ikegami (Patriarch) on Mar 18, 2010 at 15:05 UTC |