Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: regular expression search and replace

by GrandFather (Saint)
on Nov 18, 2014 at 19:55 UTC ( [id://1107629]=note: print w/replies, xml ) Need Help??


in reply to regular expression search and replace

Take a look at the transliteration operator (y/// or tr///) in Quote Like Operators. You'll need to scroll down a little of search for tr/.

Perl is the programming world's equivalent of English
  • Comment on Re: regular expression search and replace

Replies are listed 'Best First'.
Re^2: regular expression search and replace
by heman (Novice) on Nov 18, 2014 at 23:49 UTC
    Thanks guys :) All your inputs helped!! However, For some reason tr/ didn't work. It wouldn't recognize the \s in the replacement as space.

      Go read the documentation again. tr/ doesn't do \s. It isn't really related to regular expression processing, it just happens to use the same binding operator (=~).

      Perl is the programming world's equivalent of English

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-24 07:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found