Reputation: 287
I need to use regular expression in my webapp, which allows czech characters (ěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮ). Current I have
[a-zA-Z]*\w{1,20}
but this doesn't allow to input them. Thanks
Upvotes: 2
Views: 5628
Reputation: 116108
var words = Regex.Matches(inputstr, @"[ěščřžýáíéóúůďťňĎŇŤŠČŘŽÝÁÍÉÚŮĚÓa-zA-Z]{1,20}")
.Cast<Match>()
.ToArray();
Upvotes: 6
Reputation: 21
Based on this documentation you can use \p{L} to match any letter.
https://javascript.info/regexp-unicode
Upvotes: 2
Reputation: 6719
Alternative solution (works only for .NET):
[\p{Ll}\p{Lu}]{1,20}
Upvotes: 3