in reply to Substitute \W but not \.

A bit of set-theory math would lead you to /[^\w.]/. Perhaps. :)

Replies are listed 'Best First'.
Re^2: Substitute \W but not \.
by moritz (Cardinal) on Mar 13, 2008 at 14:53 UTC
    Are you sure? perlunicode says
    (However, and as a limitation of the current implementation, using "\w" or "\W" inside a "[...]" character class will still match with byte semantics.)
    which means that [^\w] is not the same as \W.
      Well, logically, those are arguably the same (at least, have been since day two), so I'd call the current implementation "buggy" if it can't make those the same.

      But thanks, I was unaware of this bug.