in reply to Mixing builtin char-classes and negation

I think you want something like this:
$a = "FATHER ANDY"; $a =~ s/[^(A\s)]/-/g; print "$a\n";
gives
-A---- A---

HTH, --traveler

Replies are listed 'Best First'.
Re: Re: Mixing builtin char-classes and negation
by sauoq (Abbot) on Jun 16, 2003 at 21:11 UTC

    He didn't say anything about parentheses.

    $a = "(woozle)"; $a =~ s/[^(A\s)]/-/g; print "$a\n";
    gives
    (------)

    -sauoq
    "My two cents aren't worth a dime.";
    
      print "I will not copy stuff from other programs without fully testin +g it" while 1;