In Perl if I use this regex /(\w+)\.(\w+)/ on the string "1A3.25D", the global vars $1 strores "1A3" and $2 stores "25D".
Is there a way to do this in C#?
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.
Certainly, look at this example:
Group[0]is the entire match (in this case the entire line because I use^and$.If you use
Regex.Replace(...)you can use$Xto incorporate the groups as you are used to 🙂