Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- public class Program
- {
- public static void Main()
- {
- string pattern = @"^(\<\[[^A-Za-z0-9]*\][\.]{1})+([\.]{1}\[[A-Za-z0-9]*\][\.]{1})*$";
- string inputLine = Console.ReadLine();
- while (inputLine != "Traincode!")
- {
- Match train = Regex.Match(inputLine,pattern);
- if (train.Success)
- {
- Console.WriteLine(inputLine);
- }
- inputLine = Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement