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;
In Section
Seekers of Perl Wisdom