mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-01 18:00:06 +00:00
Finish migrating std::regex to RE2
This commit is contained in:
parent
2757c51828
commit
2bd5ec8705
4 changed files with 26 additions and 33 deletions
|
|
@ -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() :
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue