Finish migrating std::regex to RE2

This commit is contained in:
Dan Paulat 2023-12-11 07:07:34 -06:00
parent 2757c51828
commit 2bd5ec8705
4 changed files with 26 additions and 33 deletions

View file

@ -2,10 +2,9 @@
#include <scwx/qt/settings/settings_variable.hpp>
#include <scwx/qt/util/color.hpp>
#include <regex>
#include <boost/gil.hpp>
#include <fmt/format.h>
#include <re2/re2.h>
namespace scwx
{
@ -134,8 +133,8 @@ public:
bool PaletteSettings::Impl::ValidateColor(const std::string& value)
{
static const std::regex re {"#[0-9A-Za-z]{8}"};
return std::regex_match(value, re);
static constexpr LazyRE2 re = {"#[0-9A-Fa-f]{8}"};
return RE2::FullMatch(value, *re);
}
PaletteSettings::PaletteSettings() :