Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by IndyZ (Friar)
on Apr 05, 2003 at 07:28 UTC ( #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? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2023-04-01 17:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?