fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string stroka = "На путях я вижу сорок резво скачущих сорок.";
  9. string needle = "сорок";
  10. Regex ragularka = new Regex(needle + @"(\w*)");
  11. MatchCollection matches = ragularka.Matches(stroka);
  12. foreach (Match match in matches)
  13. {
  14. Console.WriteLine(match.Value);
  15. }
  16. }
  17. }
Success #stdin #stdout 0.06s 21164KB
stdin
Standard input is empty
stdout
сорок
сорок