From 1d53321dfd0b8effcf563ed155a624ab3f693e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Leclaire-Fournier?= Date: Wed, 31 Jan 2024 18:02:31 -0500 Subject: [PATCH] Ignore les majuscules dans regex --- GPA675Lab1GOL/GOLTeamH.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPA675Lab1GOL/GOLTeamH.cpp b/GPA675Lab1GOL/GOLTeamH.cpp index db26089..a9dcfc5 100644 --- a/GPA675Lab1GOL/GOLTeamH.cpp +++ b/GPA675Lab1GOL/GOLTeamH.cpp @@ -146,7 +146,7 @@ void GOLTeamH::resize(size_t width, size_t height, State defaultState) bool GOLTeamH::setRule(std::string const& rule) { mParsedRule = 0; - std::regex regexp(R"(B(\d+)/S(\d+))"); + std::regex regexp(R"(B(\d+)/S(\d+))", std::regex_constants::icase); std::smatch m; if (std::regex_search(rule, m, regexp)) { @@ -529,7 +529,7 @@ std::optional GOLTeamH::parsePattern(std::string const& p { // \[ -> on match le caractère [ // (\d+) -> on match plusieurs caractères de 0-9 - std::regex regexp(R"(\[(\d+)x(\d+)\](\d+))"); + std::regex regexp(R"(\[(\d+)x(\d+)\](\d+))", std::regex_constants::icase); std::smatch m; if (std::regex_search(pattern, m, regexp))