If class subtraction is not supported, you should be able to use negative classes to achieve subtractions.
Some examples are [^\D] = \d
, [^[:^alpha:]] = [a-zA-Z]
Your problem could be solved like that, using a negative POSIX character class inside a character class like [^a-z[:^alpha:]CIKMOV]
[^
a-z # not a-z
[:^alpha:] # not not A-Za-z
CIKMOV # not C,I,K,M,O,V
]
Edit - This works too and might be easier to read: [^[:^alpha:][:lower:]CIKMOV]
[^
[:^alpha:] # A-Za-z
[:lower:] # not a-z
CIKMOV # not C,I,K,M,O,V
]
The result is a character class that is A-Z without C,I,K,M,O,V
basically a subtraction.
Here is a test of 2 different class concoctions (in Perl):
use strict;
use warnings;
my $match = '';
# ANYOF[^\0-@CIKMOV[-\377!utf8::IsAlpha]
for (0 .. 255) {
if (chr($_) =~ /^[^a-z[:^alpha:]CIKMOV]$/) {
$match .= chr($_); next;
}
$match .= ' ';
}
$match =~ s/^ +//;
$match =~ s/ +$//;
print "'$match'\n";
$match = '';
# ANYOF[^\0-@CIKMOV[-\377+utf8::IsDigit !utf8::IsWord]
for (0 .. 255) {
if (chr($_) =~ /^[^a-z\d\W_CIKMOV]$/) {
$match .= chr($_); next;
}
$match .= ' ';
}
$match =~ s/^ +//;
$match =~ s/ +$//;
print "'$match'\n";
Output shows the discontinuation in A-Z minus CIKMOV, from tested ascii characters 0-255:
'AB DEFGH J L N PQRSTU WXYZ'
'AB DEFGH J L N PQRSTU WXYZ'