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