Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Text.RegularExpressions;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Regex a = new Regex(@"\s[0,1][0-9]|[2][0,1,2,3]:[0-5][0-9]:[0-5][0-9]\s");
- string s = @"
- 22:02:2000 f
- 22:21:50 t
- 23:21:59 t
- 22:61:24 f
- ";
- Match list = a.Match(s);
- int ans = 0;
- while (list.Success)
- {
- ans++;
- list = list.NextMatch();
- }
- Console.WriteLine(ans);
- }
- }
- }
Add Comment
Please, Sign In to add comment