Many ready-to-use character classes are available in Perl regular expressions such as \d or \S , or novice Unicode-grokkers such as \p{P} , which matches punctuation characters .
\d
\S
\p{P}
Now let me say that I would like to combine all the punctuation marks \p{P} (quite a lot of them, and not what you want to enter manually) - all but one, all but the good old coma (or comma,, )
Is there a way to specify this requirement without extending the convenient character class and taking away komma manually?
$ unichars -au '\p{P}' | wc -l 598
Twice no:
/[^\P{P},]/ $ unichars -au '[^\P{P},]' | wc -l 597
And through lookahead / lookbehind:
/\p{P}(?<!,)/ $ unichars -au '\p{P}(?<!,)' | wc -l 597
unichars
try it
[^\P{P},]
This is a negative character class that matches all but the listed characters.
\P{P} denied \P{P}
\P{P}