in reply to negating POSIX regexp classes doesn't work as expected

Am I correct in thinking this is a bug?

Yes, but unfortunately it's yours:

my $a = "123{12\n"; print "ACK digit!\n" if ($a =~ /[^:digit:]/); print "ACK \\D!\n" if ($a =~ /\D/);

The POSIX class names include the colons.

Update: I wrote a bad test case. Sorry for the noise.

Replies are listed 'Best First'.
Re^2: negating POSIX regexp classes doesn't work as expected
by Roy Johnson (Monsignor) on Apr 11, 2005 at 18:52 UTC
    Wrong two ways. The caret should be after the colon (Update: or just inside the outer brackets, in which case it's normal charset negation and not a POSIX extension), and the brackets need to be doubled. Did you test this? Did you try it with and without nondigits in the string?

    Caution: Contents may have been coded under pressure.