I need a regex pattern that accepts words but if the words contains underscore / dashes or number it is not valid so:
Word ---> good
Word1.0 ---> no
word_1 ---> no
I need a regex pattern that accepts words but if the words contains underscore / dashes or number it is not valid so:
Word ---> good
Word1.0 ---> no
word_1 ---> no
Use
\A[\p{L}\p{M}]+\z
In C#:
var result = Regex.IsMatch(input, @"\A[\p{L}\p{M}]+\z");
Details:
\A - start of string (replace with (?![\p{M}\p{L}]) if partial match is required)[\p{L}\p{M}]+ - 1 or more letters or diacritic characters\z - the very end of the string.