It seems RegexOptions.CultureInvariant does not work.
var match = Regex.Match("välue", @"^[a-zA-Z0-9_-]+$", RegexOptions.CultureInvariant);
//match.Success is flase!!!
I'm trying to match all alphanumeric strings in different cultures.
It seems RegexOptions.CultureInvariant does not work.
var match = Regex.Match("välue", @"^[a-zA-Z0-9_-]+$", RegexOptions.CultureInvariant);
//match.Success is flase!!!
I'm trying to match all alphanumeric strings in different cultures.
Maybe this will helps someone.
var match = System.Text.RegularExpressions.Regex.Match("välueÇöıÜ_-", @"^[\p{L}0-9_-]+$", System.Text.RegularExpressions.RegexOptions.CultureInvariant);
\p{L} matches any letters.