#include <regex>
#include <string>
#include <iostream>
using namespace std;
int main()
{
string input =R"(This text is <ul>pretty long, but will be
concatenated into just a single string.
The disadvantage is that you have to quote
each part, and </ul>newlines must be literal as
usual.)";
string regx = R"(<ul>([\s\S]*?)<\/ul>)";
smatch matches;
if (regex_search(input, matches, regex(regx)))
{
cout<<matches[1]<<"."<<endl;
}
return 0;
}
I2luY2x1ZGUgPHJlZ2V4PgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpCnsKCXN0cmluZyBpbnB1dCA9UiIoVGhpcyB0ZXh0IGlzIDx1bD5wcmV0dHkgbG9uZywgYnV0IHdpbGwgYmUgCgkgIGNvbmNhdGVuYXRlZCBpbnRvIGp1c3QgYSBzaW5nbGUgc3RyaW5nLiAKCSAgIFRoZSBkaXNhZHZhbnRhZ2UgaXMgdGhhdCB5b3UgaGF2ZSB0byBxdW90ZSAKCSAgZWFjaCBwYXJ0LCBhbmQgPC91bD5uZXdsaW5lcyBtdXN0IGJlIGxpdGVyYWwgYXMgCgkgIHVzdWFsLikiOwoKCXN0cmluZyByZWd4ID0gUiIoPHVsPihbXHNcU10qPyk8XC91bD4pIjsKCXNtYXRjaCBtYXRjaGVzOwoJaWYgKHJlZ2V4X3NlYXJjaChpbnB1dCwgbWF0Y2hlcywgcmVnZXgocmVneCkpKQoJewoJCWNvdXQ8PG1hdGNoZXNbMV08PCIuIjw8ZW5kbDsKCX0KCglyZXR1cm4gMDsKfQ==