I would like to do something like the below but throw an exception because there is no match. Is that possible?
var val = Regex.Match("nomatchplz", "notgoingtomatch(.*)").Groups[1].Value;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Doesn’t .Value already throw a NullReferenceException because Group[1] is false? Or is Group[1] already cause an ArgumentOutOfRangeException because the Indexer can’t be resolved?