Advertisement
Tark_Wight

Untitled

Mar 16th, 2023
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4.  
  5. namespace ConsoleApp1
  6. {
  7. internal class Program
  8. {
  9. static void Main()
  10. {
  11. string возможныйПаттернИлиЕгоЧасть...
  12. strint этихСтрокМожетИНеБыть...
  13.  
  14. string pattern = @"итоговый регекс из строк выше";
  15.  
  16. Regex reg = new Regex(pattern);
  17.  
  18. string input = Console.ReadLine();
  19.  
  20. while (input != null)
  21. {
  22. MatchCollection matches = reg.Matches(input);
  23.  
  24. for (int count = 0; count < matches.Count; count++)
  25. {
  26. Console.WriteLine(matches[count].Value);
  27. }
  28.  
  29. input = Console.ReadLine();
  30. }
  31. }
  32. }
  33. }
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement