using System.Text.RegularExpressions;
public class ExtractHyperlinks
public static void Main(string[] args)
string input = "You are part of the back-end development team of the next Facebook. You are given a line of usernames, between one of the following symbols: space, “\\/”, “\\”, “(“, “)” . First you have to export all valid usernames. A valid username starts with a letter and can contain only letters, digits and “_”. It cannot be less than 3 or more than 25 symbols long. Your task is to sum the length of every 2 consecutive valid usernames and print on the console the 2 valid usernames with biggest sum of their lengths, each on a separate line. ";
Regex rgx = new Regex(@"[^a-z]*");
Match match = rgx.Match(input);
while (match != Match.Empty)
Console.Write(match.Value);
match = match.NextMatch();