fork(1) download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var text = "xy_yx_blaa_184\r\n\r\nis the act of composing and sending electronic messages, typically\r\nconsisting of alphabetic and numeric characters, between two or more\r\nusers of mobile phones, tablets, desktops/laptops, or other devices.\r\nText messages may be sent over a cellular network, or may also be sent\r\nvia an Internet connection.\r\n\r\nDerived\r\n\r\nQM\r\n\r\nSW\r\n\r\nxy_yx_blaa_199\r\n\r\nis the act of composing and sending electronic messages, typically\r\nconsisting of alphabetic and numeric characters, between two or more\r\nusers of mobile phones, tablets, desktops/laptops, or other devices.\r\nText messages may be sent over a cellular network, or may also be sent\r\nvia an Internet connection.\r\n\r\nDerived\r\n\r\nA\r\n\r\nSW";
  12. var pattern = @"^xy_yx_blaa_(\d+)(.*?)(^[A-D]\r?$|QM)+.*?(?:SW|Analyzing)";
  13. var results = Regex.Matches(text, pattern, RegexOptions.Multiline | RegexOptions.Singleline)
  14. .Cast<Match>()
  15. .Select(m => m.Value)
  16. .ToList();
  17. foreach (var r in results)
  18. Console.WriteLine("{0}\n----------------", r);
  19. }
  20. }
Success #stdin #stdout 0.08s 20468KB
stdin
Standard input is empty
stdout
xy_yx_blaa_184

is the act of composing and sending electronic messages, typically
consisting of alphabetic and numeric characters, between two or more
users of mobile phones, tablets, desktops/laptops, or other devices.
Text messages may be sent over a cellular network, or may also be sent
via an Internet connection.

Derived

QM

SW
----------------
xy_yx_blaa_199

is the act of composing and sending electronic messages, typically
consisting of alphabetic and numeric characters, between two or more
users of mobile phones, tablets, desktops/laptops, or other devices.
Text messages may be sent over a cellular network, or may also be sent
via an Internet connection.

Derived

A

SW
----------------