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";
var pattern = @"^xy_yx_blaa_(\d+)(.*?)(^[A-D]\r?$|QM)+.*?(?:SW|Analyzing)";
var results = Regex.Matches(text, pattern, RegexOptions.Multiline| RegexOptions.Singleline)
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
----------------