8 enabled pcre and I am trying to match the \p{Po} group plus a bunch of other stuff.
I want to exclude the ampersand character. How do I exclude a specific character out of the class?
-- lua btw
local utf8_general_punctuation_reg = "[\\p{Po}\\p{Cc}\\p{Cs}\\p{Pc}\\p{Pe}\\p{Ps}\\p{Pf}\\p{Pi}\\p{Sm}\\x{2100}-\\x{2123}\\x{2600}-\\x{26ff}]+"
Thanks in advance!
BTW \p{Po} is for utf8 http://www.fileformat.info/info/unicode/category/Po/list.htm
Just adding what works from the answer below:
local utf8_general_punctuation_reg = "[\\p{Po}\\p{Cc}\\p{Cs}\\p{Pc}\\p{Pe}\\p{Ps}\\p{Pf}\\p{Pi}\\p{Sm}\\x{2100}-\\x{2123}\\x{2600}-\\x{26ff}]+(?<!(&|\\.|:))"
You can use negative lookbehind for this. I’m not familiar with pcre syntax.
That regex first allows a or b or c, just look the Unicode Property allows different characters, and then disallow the b character with negative lookbehind.
The regex above will match a and c in the end but not b.