fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. var re = new Regex(@"\b[аеоиуюэяёы][а-яё][аеоиуюэяёы]\b",
  9. RegexOptions.IgnoreCase | RegexOptions.Compiled);
  10.  
  11. string text = Console.In.ReadToEnd();
  12. foreach (Match match in re.Matches(text))
  13. Console.WriteLine($" --> match at index {match.Index}, length {match.Length}, text {match.Value}");
  14. }
  15. }
Success #stdin #stdout 0.03s 30504KB
stdin
ага
ого
нет
три
четыре
qwe
ага ого угу хрю гав мяу тпру но ыыы
stdout
  --> match at index 0, length 3, text ага
  --> match at index 4, length 3, text ого
  --> match at index 27, length 3, text ага
  --> match at index 31, length 3, text ого
  --> match at index 35, length 3, text угу
  --> match at index 59, length 3, text ыыы