newbie1991 has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to separate a repeated substring from a really long string. I cannot use the offset numbers because they are all variable length. I want to split into substrings using particular delimiters, for example, (code given below), I want the parts from > to the first \n after the > in one string, and \n to the next > in another string. Using split seems way too cumbersome and would need too many statements. Substr function requires length or offset, but they are variable. Is there a shorter way?
"> abcd1234 abcd abcd >xyz123 xyz"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Separating substrings from a main string
by blue_cowdawg (Monsignor) on Jan 24, 2013 at 14:19 UTC | |
by newbie1991 (Acolyte) on Jan 24, 2013 at 14:29 UTC | |
by blue_cowdawg (Monsignor) on Jan 24, 2013 at 14:55 UTC | |
Re: Separating substrings from a main string
by Athanasius (Archbishop) on Jan 24, 2013 at 14:25 UTC | |
Re: Separating substrings from a main string
by Kenosis (Priest) on Jan 24, 2013 at 18:37 UTC |
Back to
Seekers of Perl Wisdom