Guest User

Untitled

a guest
Jul 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text.RegularExpressions;
  5. using System.Threading.Tasks;
  6.  
  7. namespace RegularExpression
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var subject = "zzzzcatzzzzzzcatzzzz";
  14. var regex = new Regex("(cat)+");
  15. var match = regex.Match(subject);
  16.  
  17. while(match.Success)
  18. {
  19. Console.WriteLine($"Match: { match.Success} \n " +
  20. $"Index: { match.Index} \n " +
  21. $"Length: { match.Length} \n " +
  22. $"Value: { match.Value}");
  23. match = match.NextMatch();
  24. }
  25.  
  26. Console.ReadKey();
  27. }
  28.  
  29. }
  30. }
Add Comment
Please, Sign In to add comment