Advertisement
Guest User

Zad 3

a guest
Aug 22nd, 2017
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Text.RegularExpressions;
  6. namespace exam
  7. {
  8.     class exam
  9.     {
  10.         static void Main()
  11.         {
  12.             Regex pattern = new Regex(@"^(<\[[^a-zA-Z0-9]*\]\.){1}(\.\[[a-zA-Z0-9]*\]\.)*$");
  13.  
  14.             string input = Console.ReadLine();
  15.  
  16.             while (input != "Traincode!")
  17.             {
  18.                 if (pattern.IsMatch(input))
  19.                 {
  20.                     Console.WriteLine(input);
  21.                 }
  22.  
  23.                 input = Console.ReadLine();
  24.             }
  25.  
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement