fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var s = "Завтрак в 22:30;";
  12. var regex = new Regex(@"\b(?:[01][0-9]|2[0-3]):[0-5][0-9]\b");
  13. var matches = regex.Matches(s).Cast<Match>().Select(x => x.Value);
  14. foreach (var match in matches)
  15. {
  16. Console.Write(match);
  17. }
  18. }
  19. }
Success #stdin #stdout 0.06s 28156KB
stdin
Standard input is empty
stdout
22:30