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

I don't think one needs use POSIX, at least with the more recent versions of perl; e.g. with v5.8.4:

#!perl -l use strict; use warnings; my $s = 'a1b2c3'; print for $s =~ /[[:alpha:]]/g; print for $s =~ /[[:digit:]]/g; __END__ a b c 1 2 3

the lowliest monk

Replies are listed 'Best First'.
Re^3: negating POSIX regexp classes doesn't work as expected
by Roy Johnson (Monsignor) on Apr 12, 2005 at 00:53 UTC
    You are correct, sir. I had thought it was use POSIX that caused it to bark at me when I didn't have the doubled brackets (POSIX syntax [: :] belongs inside character classes in regex), but it seems that it will bark without it. In either case, it only barks for positive char classes like [:digit:], not for negated ones like [:^digit:].

    Caution: Contents may have been coded under pressure.