If class subtraction is not supported, you should use negative classes to achieve subtractions.
Some examples: [^\D] = \d , [^[:^alpha:]] = [a-zA-Z]
Your problem can be solved in a similar way using a negative POSIX character class inside a character class, for example [^az[:^alpha:]CIKMOV]
[^
az # not az
[:^alpha:] # not not A-Za-z
CIKMOV # not C,I,K,M,O,V
]
Change This also works and it might be easier to read: [^[:^alpha:][:lower:]CIKMOV]
[^
[:^alpha:] # A-Za-z
[:lower:] # not az
CIKMOV # not C,I,K,M,O,V
]
The result is a character class that is AZ without C, I, K, M, O, V
basically subtraction.
Here is a test of two different classes (in Perl):
use strict; use warnings; my $match = '';
The output shows a termination in AZ minus CIKMOV, from ascii 0-255 checked characters:
'AB DEFGH JLN PQRSTU WXYZ'
'AB DEFGH JLN PQRSTU WXYZ'
sln
source share