fork(1) 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 input;
  12. string text = "";
  13. while ((input = Console.ReadLine()) != null) text += "\n"+input;
  14. Console.WriteLine($"Input text: {text}");
  15. foreach (Match match in re.Matches(text))
  16. Console.WriteLine($" --> match at index {match.Index}, length {match.Length}, text {match.Value}");
  17. }
  18. }
Success #stdin #stdout 0.02s 30504KB
stdin
ага
ого
нет
три
четыре
qwe
ага ого угу хрю гав мяу тпру но ыыы
stdout
Input text: 
ага
ого
нет
три
четыре
qwe
ага ого угу хрю гав мяу тпру но ыыы
  --> match at index 1, length 3, text ага
  --> match at index 5, length 3, text ого
  --> match at index 28, length 3, text ага
  --> match at index 32, length 3, text ого
  --> match at index 36, length 3, text угу
  --> match at index 60, length 3, text ыыы