Mono’s Regex implementation has a bug which means it does not handle regex character class subtraction correctly.
IE: “[ab-[a]]” should in effect be the character set “[b]”.
For example the following code on .NET will output “The\ncat\nsat\non\nthe\nmat”.
This example contains the simplified regex that I am trying to make work on mono.
string listOfUnicodeChars = "\u2e80";
string patten =
"[\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lo}\\p{Mn}\\p{Mc}\\p{Lm}-[" + listofUnicodeChars +"]]+";
Regex regex = new Regex(pattern);
foreach (var match in regex.Matches("The cat sat on the mat."))
Console.WriteLine(match);
but using mono the regex matches nothing.
Does anyone have any suggestions about how to get the same affect with the regex written a different way?
Have you considered using a negative lookahead? Such as: