anniyan has asked for the wisdom of the Perl Monks concerning the following question:
I have a string like
$str = '<chap&&<book||<table&&<list';I want to split that with && and || but i dont want to include those && and || in the array.
If i use the following code, it splits correctly but it stores the && and || in the array.
@arr = split /(?=(&&|\|\|))/, $str;How to do this?
Regards,
Anniyan
(CREATED in HELL by DEVIL to s|EVILS|GOODS|g in WORLD)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split with separators but dont include in the array
by ikegami (Patriarch) on Oct 17, 2005 at 15:29 UTC | |
|
Re: split with separators but dont include in the array
by Roy Johnson (Monsignor) on Oct 17, 2005 at 15:29 UTC | |
by anniyan (Monk) on Oct 17, 2005 at 15:44 UTC | |
by Roy Johnson (Monsignor) on Oct 17, 2005 at 15:55 UTC | |
by McDarren (Abbot) on Oct 17, 2005 at 15:57 UTC | |
by polettix (Vicar) on Oct 17, 2005 at 23:33 UTC | |
|
Re: split with separators but dont include in the array
by Limbic~Region (Chancellor) on Oct 17, 2005 at 15:27 UTC | |
by anniyan (Monk) on Oct 17, 2005 at 15:37 UTC |