/[[:punct:]]/ /\p{IsPunct}/ #### for $x ( 0x20 .. 0x7e ) { $_ = chr( $x ); $res = ( /[[:punct:]]/ ) ? "matches :punct:" : "is not a :punct:"; $res .= ( /\p{IsPunct}/ ) ? " matches {IsPunct}" : " fails on {IsPunct}"; printf( " 0x%x (%3d.) %s %s\n", $x, $x, $_, $res ) if ( $res =~ /matches/ ); }