in reply to Split tags and words nicely
Hi bwgoudey,
I think you may be looking for this:
I think you may be looking for this:
The main trick is to use () inside the regex used in split to capture the delimiters.$a=q{<tag ref=1>Start<tag ref=2>and more</tag>and end</tag>}; @l=split qr{(</?tag[^>]*>)}, $a; print join "\n", @l;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Split tags and words nicely
by logie17 (Friar) on Dec 28, 2006 at 21:04 UTC | |
by johngg (Canon) on Dec 29, 2006 at 10:37 UTC | |
by logie17 (Friar) on Dec 31, 2006 at 02:18 UTC |
In Section
Seekers of Perl Wisdom