Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

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

by Abigail-II (Bishop)
on Apr 05, 2003 at 07:30 UTC ( #248269=note: print w/replies, xml ) Need Help??


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

I think the above is fine, but if you insist on less lines:
%& = ("\t" => '\t', "\n" => '\n', "\r" => '\r', "\f" => '\f'); s/[\t\n\r\f]/$&{$&}/g;

I wouldn't call it simpler though.

Abigail

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2023-03-24 06:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?