Switch regex option multiline on
And use a begin-of-line anchor in the pattern, which makes it faster and more specific.
This commit is contained in:
@@ -57,7 +57,7 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
sc::requester req;
|
||||
std::string text {req.get("https://gitlab.com/gitlab-org/gitlab-foss/-/raw/master/CHANGELOG.md")};
|
||||
std::regex pat {R"(##\s+(\d+\.\d+\.\d+)\s+\((\d+-\d+-\d+))"};
|
||||
std::regex pat {R"(^##\s+(\d+\.\d+\.\d+)\s+\((\d+-\d+-\d+))", std::regex::multiline};
|
||||
std::sregex_iterator beg {text.begin(), text.end(), pat};
|
||||
std::sregex_iterator end {};
|
||||
for (std::sregex_iterator i = beg; i != end; ++i) {
|
||||
|
Reference in New Issue
Block a user