Advertisement
social1986

Untitled

Oct 27th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text.RegularExpressions;
  4.  
  5. public class Example
  6. {
  7. public static void Main()
  8. {
  9. string input = Console.ReadLine();
  10. string pattern = @"(\w+)-\1";
  11. var didimon = new List<string>();
  12. var bojomon = new List<Group>();
  13.  
  14. foreach (Match m in Regex.Matches(input, pattern))
  15. {
  16. bojomon.Add(m);
  17.  
  18. }
  19. var result = Regex.Split(input, @"(\w+)-\1");
  20. foreach (var item in result)
  21. {
  22. didimon.Add(item);
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement