Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Avoid recursive replacement using regex

by Loops (Curate)
on Nov 25, 2014 at 12:39 UTC ( [id://1108345]=note: print w/replies, xml ) Need Help??


in reply to Avoid recursive replacement using regex

Sure, just translate this into JavaScript:

my %k = qw(l < g > & &); print "$_ to ".s/(&)amp;|&(l|g)t;/$k{$+}/reg.$/ for qw( &amp; &amp;lt; &amp;gt; &lt; &gt; );
Prints:
&amp; to & &amp;lt; to &lt; &amp;gt; to &gt; &lt; to < &gt; to >
(sorry) :P

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1108345]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 00:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found