in reply to negating POSIX regexp classes doesn't work as expected
Output from CL execution of perl cazz.pl#!/usr/bin/perl my $a = "123{12\n"; print "ACK digit! per cazz posix\n" if ($a =~ /[:^digit:]/); print "\npast cazz posix\n"; print "ACK digit! per ww-digit-posix\n" if ($a =~ /[^:digit:]/); print "\tpast ww posix\n"; print "ACK digit! per ww-ISdigit-posix\n" if ($a =~ /[^:isdigit:]/); print "\tpast ww ISdigit-posix\n"; print "ACK ISdigit! per cazz-ISdigit-posix\n" if ($a =~ /[:^isdigit:]/ +); print "\npast cazz ISdigit posix\n"; print "ACK \\D!\n" if ($a =~ /\D/);
changes output:print "ACK digit! per ww-ISdigit-posix\n" if ($a =~ /[[^:isdigit:]]/); + #changed; dbl brkts
|
|---|