Regex reg = new Regex("^[a-zA-Z]+$");
^
start of the string[]
character set\+
one time or the more$
end of the string
^
and $
needed because you want validate all string, not part of the string
More Related Contents:
- How do I get two numbers between two words (C#) [closed]
- c# RegEx, how to filter the resultset of regex [closed]
- C#. split identificator on the words [closed]
- \d less efficient than [0-9]
- Regex for numbers only
- Find and extract a number from a string
- Using C# regular expressions to remove HTML tags
- How can I strip HTML tags from a string in ASP.NET?
- C# Regex Split – commas outside quotes
- regex for accepting only persian characters
- Regular Expression Groups in C#
- Order of regular expression operator (..|.. … ..|..)
- Regular Expression to split on spaces unless in quotes
- Why does the order of alternatives matter in regex?
- Remove HTML tags from string including   in C#
- Poor man’s “lexer” for C#
- Regular expression to allow backslash in C#
- Improving/Fixing a Regex for C style block comments
- Are Java and C# regular expressions compatible?
- C# – Regex for file paths e.g. C:\test\test.exe
- C# Regular Expressions, string between single quotes
- How do I get the name of captured groups in a C# Regex?
- C# Regex.Split: Removing empty results
- How to use inline modifiers in C# regex?
- Regular expression to find and remove duplicate words
- using static Regex.IsMatch vs creating an instance of Regex
- What is a “Nested Quantifier” and why is it causing my regex to fail?
- Splitting a string in C#
- regex to split line (csv file)
- Regex to match a string after colon