Advertisement
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.RegularExpressions;
- namespace P03._Camera_View
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] numbers = Console.ReadLine().Split().Select(int.Parse).ToArray();
- string text = Console.ReadLine();
- string pattern = @"[|<]+([\w]{" + numbers[0] + @"})([\w]{0," + numbers[1] +@"})";
- MatchCollection match = Regex.Matches(text, pattern);
- List<string> result = new List<string>();
- foreach (Match m in match)
- {
- result.Add(m.Groups[2].Value);
- }
- Console.WriteLine(string.Join(", ",result));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement