We don't bite newbies here... much | |
PerlMonks |
split with separators but dont include in the arrayby anniyan (Monk) |
on Oct 17, 2005 at 15:23 UTC ( [id://500743]=perlquestion: print w/replies, xml ) | Need Help?? |
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,
Back to
Seekers of Perl Wisdom
|
|