I'm currently trying to implement a check for a regex matching an input string, which i would like to only validate letters a-z, (lower or caps) excluding all numbers, special characters...
However, if the regex matches partially, Regex.Match(input)
will return true. I would like it to return false unless the entire input string is valid, how would i go about this?
Here is an example if how i would like it to work, the Regex pattern shown is what i'm currently using.
Regex expression = new Regex("^[a-zA-Z]*");
if(!expression.IsMatch("example123")) { /* do something */ }
As it is right now, the Regex will match up to "example", and still return true, even though it contains "123" at the end.