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;
- using System.Text.RegularExpressions;
- namespace ExamSecondPreparation
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<string> l = new List<string>();
- string pattern = @"(^<\[[^a-zA-Z0-9]*\]\.(\.\[[a-zA-Z0-9]*\]\.)*)$";
- string text = Console.ReadLine();
- while (text != "Traincode!")
- {
- if (Regex.IsMatch(text, pattern))
- {
- l.Add(text);
- }
- text = Console.ReadLine();
- }
- foreach (var item in l)
- {
- Console.WriteLine(item);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement