str::size_type extract_delimited_text(const str& in, const str& d1, const str& d2, str& out, size_t pos) { if(pos == str::npos) return pos; size_t end = pos; if((pos = in.find(d1, pos)) != str::npos) if((end = in.find(d2, (pos = pos + d1.size()))) != str::npos) { out = in.substr(pos, end - pos); return end + d2.size(); } return str::npos; }
bool is_multi_line(const str& s) { return s.find('\n') != str::npos; }