maha has asked for the wisdom of the Perl Monks concerning the following question:
I want to split a string into multiple strings for given below example
(e.g)
<P_contrib-author>Allan Wigfield, Susan L. Klauda, and Jenna Cambria</P_contrib-author>output should be
<contrib-group> <name><surname>Wigfield</surname><given-names>Allan</given-names></nam +e> <name><surname>Klauda</surname><given-names>Susan L.</given-names></na +me> <name><surname>Cambria</surname><given-names>Jenna</given-names></name +> </contrib-group>
I used following code
@arr = split(/(,|and)/,$cont)but it could't show the full content
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split function using multiple delimiters
by ambrus (Abbot) on Dec 27, 2011 at 12:35 UTC | |
|
Re: split function using multiple delimiters
by ww (Archbishop) on Dec 27, 2011 at 11:44 UTC | |
by educated_foo (Vicar) on Dec 27, 2011 at 12:05 UTC | |
by Lotus1 (Vicar) on Dec 27, 2011 at 17:58 UTC | |
by JavaFan (Canon) on Dec 27, 2011 at 19:19 UTC | |
by educated_foo (Vicar) on Dec 27, 2011 at 21:00 UTC | |
by Anonymous Monk on Dec 28, 2011 at 08:10 UTC | |
|
Re: split function using multiple delimiters
by zwon (Abbot) on Dec 27, 2011 at 11:23 UTC | |
|
Re: split function using multiple delimiters
by jhourcle (Prior) on Dec 29, 2011 at 18:56 UTC | |
|
Re: split function using multiple delimiters
by cavac (Prior) on Dec 27, 2011 at 19:03 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |