Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text.RegularExpressions;
- using System.Threading.Tasks;
- namespace RegularExpression
- {
- class Program
- {
- static void Main(string[] args)
- {
- var subject = "zzzzcatzzzzzzcatzzzz";
- var regex = new Regex("(cat)+");
- var match = regex.Match(subject);
- while(match.Success)
- {
- Console.WriteLine($"Match: { match.Success} \n " +
- $"Index: { match.Index} \n " +
- $"Length: { match.Length} \n " +
- $"Value: { match.Value}");
- match = match.NextMatch();
- }
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment