in reply to substitute with space

Don't use a character class on the replacement side of a search/replace. If you want a space, use ' '. Even if \s worked there, it'd be ambiguous since it could be a space, a tab, or something else. See perlre.

Replies are listed 'Best First'.
Re^2: substitute with space
by vitaly (Acolyte) on Sep 10, 2007 at 02:15 UTC
    When using $keyword =~ s/\+/' '/g; After replacement of Auto+Recycling+%26+Dismantling I got Auto' 'Recycling' '%26' 'Dismantling Instead of Auto Recycling %26 Dismantling
      Don't include the quotes. The quotes are there in my node to quote the string. They are not part of the string they are quoting.
        Thank you both very much!!! It works with /\+/ /. How could I imagine the it's possible to replace with Regex. Shame on me.