Regex in C#

Recent had to ramp up on my regex skills. i was using C#,  so decided to explore the Regex libs in C#

Some use cases.

  • Finding matches.
    • Lets say I want to extract all the numbers present in a string.
    • I identify the proper regex to use. So in this case “\d+”
    • Use Regex.matches. e.g.
var digitsGroups = Regex.Matches(username, @"\d+", RegexOptions.IgnoreCase);




Also, check this out :