fork download
  1. using System;
  2. using System.Linq;
  3. using System.Text.RegularExpressions;
  4. using System.IO;
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var s = "The server IP is -> 127.1.2.35:9001!";
  10. var result = Regex.Match(s, @"[0-9]+:[0-9]+");
  11. if (result.Success)
  12. Console.WriteLine(result.Value);
  13.  
  14. }
  15.  
  16. }
Success #stdin #stdout 0.02s 30232KB
stdin
Standard input is empty
stdout
35:9001