cazz has asked for the wisdom of the Perl Monks concerning the following question:
Today, I ran into an instance that perlre(1) says should work but does not.
You can negate the [::] character classes by prefixing the class name with a '^'. This is a Perl extension.
Both statements should bitch about having a non-digit character in $a. However, only the \D method bitches. Am I correct in thinking this is a bug?#!/usr/bin/perl my $a = "123{12\n"; print "ACK digit!\n" if ($a =~ /[:^digit:]/); print "ACK \\D!\n" if ($a =~ /\D/);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: negating POSIX regexp classes doesn't work as expected
by Roy Johnson (Monsignor) on Apr 11, 2005 at 18:49 UTC | |
by tlm (Prior) on Apr 11, 2005 at 23:20 UTC | |
by Roy Johnson (Monsignor) on Apr 12, 2005 at 00:53 UTC | |
|
Re: negating POSIX regexp classes doesn't work as expected
by tlm (Prior) on Apr 11, 2005 at 18:53 UTC | |
|
Re: negating POSIX regexp classes doesn't work as expected
by ikegami (Patriarch) on Apr 11, 2005 at 19:09 UTC | |
|
Re: negating POSIX regexp classes doesn't work as expected
by ww (Archbishop) on Apr 11, 2005 at 18:52 UTC | |
|
Re: negating POSIX regexp classes doesn't work as expected
by chromatic (Archbishop) on Apr 11, 2005 at 18:45 UTC | |
by Roy Johnson (Monsignor) on Apr 11, 2005 at 18:52 UTC |