Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Can this be a 1 line or simpler regex?

by IndyZ (Friar)
on Apr 05, 2003 at 07:28 UTC ( [id://248268]=note: print w/replies, xml ) Need Help??


in reply to Can this be a 1 line or simpler regex?

This works:

s/([\t\n\r\f])/%m=("\t","\\t","\n","\\n","\r","\\r","\f","\\f");$m{$1}/ge;

but it just feels dirty.

--
IndyZ

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found