danmcb has asked for the wisdom of the Perl Monks concerning the following question:
This is a problem for a routine(s) I'm thinking of writing.
Given a piece of text like this:
Something like this must exist - anyone know where?
thanks
Daniel
Given a piece of text like this:
I want an array (or other collection) of these strings"my text [and maybe|and here's] more text"
given this line:"my text and maybe more text" "my text and here's more text"
I would get:"my text [and maybe|and here's] more text [the end|stop]"
and given:"my text and maybe more text the end" "my text and here's more text the end" "my text and maybe more text stop" "my text and here's more text stop"
I want:"my text [[and|or] maybe|and here's] more text"
(all characters except | should be just treated like text)"my text and maybe more text" "my text or maybe more text" "my text and here's more text"
Something like this must exist - anyone know where?
thanks
Daniel
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: strings with options - how do I do this?
by blakem (Monsignor) on Feb 27, 2003 at 10:21 UTC | |
by Hofmator (Curate) on Feb 27, 2003 at 10:31 UTC | |
by blakem (Monsignor) on Feb 27, 2003 at 11:04 UTC | |
by Anonymous Monk on Feb 27, 2003 at 13:32 UTC | |
by danmcb (Monk) on Feb 27, 2003 at 10:27 UTC | |
by tye (Sage) on Feb 27, 2003 at 18:22 UTC |
Back to
Seekers of Perl Wisdom