Is there a difference between ^[a-zA-Z] and [^a-zA-Z]?
When I check in C#,
Regex.IsMatch("t", "^[a-zA-Z]") // Returns true (I think it's correct)
Regex.IsMatch("t", "[^a-zA-Z]") // Returns false
There are a lot of web sites using [^a-zA-Z] for the alphabet. I’m not really sure which one is correct answer.
Yes, the first means “match all strings that start with a letter”, the second means “match all strings that contain a non-letter”. The caret (“^”) is used in two different ways, one to signal the start of the text, one to negate a character match inside square brackets.