MilenaPetkanova

Example

Oct 27th, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 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+)((\w+)-\3)(\W+)";
  11. var didimon = new List<Group>();
  12. var bojomon = new List<Group>();
  13.  
  14. var regex1 = Regex.Matches(input, pattern);
  15.  
  16. foreach (Match m in Regex.Matches(input, pattern))
  17. {
  18. bojomon.Add(m.Groups[2]);
  19. didimon.Add(m.Groups[1]);
  20. didimon.Add(m.Groups[4]);
  21. }
  22.  
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment