Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Where to add substitution?

by linuxer (Deacon)
on May 05, 2009 at 20:04 UTC ( #762048=note: print w/ replies, xml ) Need Help??


in reply to Where to add substitution?

Seeing your regex s/\t||\r||\n||\f//g I think you should check the documentation of perlretut, perlrequick, and perlre.

I assume you wanted to remove any occurence of \t, \r, \n or \f.

You could use a character class in regex for this

$text =~ s/[\t\r\n\f]//g

or you could use tr///d (see tr/SEARCHLIST/REPLACEMENTLIST/cds)

$text =~ tr/\t\r\n\f//d


Comment on Re: Where to add substitution?
Select or Download Code
Replies are listed 'Best First'.
Re^2: Where to add substitution?
by reclusivemonkey (Initiate) on May 05, 2009 at 21:45 UTC
    Thanks for all the replies monks, they have been most helpful.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (12)
As of 2015-07-30 18:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls