Advertisement
nikolayneykov

Untitled

Mar 30th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. class Program
  5. {
  6.     static void Main(string[] args)
  7.     {
  8.         Regex pattern = new Regex(@"(?<=^|,\s)([\w\-]{3,16})(?=$|,\s)");
  9.         string input = Console.ReadLine();
  10.         MatchCollection matches = pattern.Matches(input);
  11.  
  12.         foreach (var match in matches)
  13.         {
  14.             Console.WriteLine(match);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement