C# Regular Exression "^[a-zA-Z]" or "[^a-zA-Z]"
- by winmyan
Is there a differnet between ^[a-zA-Z] or [^a-zA-Z]?
When I check in C#,
Regex.IsMatch("t", "^[a-zA-Z]") // Return true (I think it's correct)
Regex.IsMatch("t", "[^a-zA-Z]") // Return false
There are alot of web site using [^a-zA-Z] for alphabet. I'm not really sure which one is correct answer.
Could someone please shed the light?