The following snippet prints False:
False
Console.WriteLine(Regex.IsMatch("abc", @"[[:alpha:]]"));
But this prints True:
True
Console.WriteLine(Regex.IsMatch("abc", @"[a-zA-Z]"));
Why? Shouldn't they be equivalent?
.NET Regexes do not support Posix character classes. However, they do support Unicode groups.
This will work:
Regex.IsMatch("abc", @"^\p{L}+$");
The group \p{L}matches all Unicode characters.
\p{L}
See here for more information:
http://msdn.microsoft.com/en-us/library/20bw873z.aspx#CategoryOrBlock