in reply to Re: Split tags and words nicely
in thread Split tags and words nicely
Along the same lines, here's something that is completely regex and no join or split is needed. Probably could be obfuscated even more :)
Prints the following:
Cheers!
$a = q{<tag ref=1>Start<tag ref=2>and more</tag>and end</tag>}; my @b; $a =~ s/(<\/?tag[^>]*>)(\w*)/push @b, ($1,$2)/eg; map {print $_,"\n"} @b;
Prints the following:
<tag ref=1> Start <tag ref=2> and </tag> and </tag>
Cheers!
s;;5776?12321=10609$d=9409:12100$xx;;s;(\d*);push @_,$1;eg;map{print chr(sqrt($_))."\n"} @_;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Split tags and words nicely
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