KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
So if I write a regex it's matches I can get the match or I can access its groups. This seems counter intuitive since the groups are defined in the expression with braces "(" and ")". It seems like it is not only wrong but redundant. Any one know why? Regex quickCheck = new Regex(@"(\D+)\d+"); string source = "abc123"; m.Value //Equals source m.Groups.Count //Equals 2 m.Groups[0]) //Equals source m.Groups[1]) //Equals "abc"
Tags (comma-separated)
Save Edits
Cancel