This commit is contained in:
Sylvain Corlay 2017-10-31 21:07:45 +00:00 committed by GitHub
commit 56362b594e

View File

@ -428,11 +428,6 @@ namespace cxxopts
namespace values namespace values
{ {
namespace
{
std::basic_regex<char> integer_pattern
("(-)?(0x)?([1-9a-zA-Z][0-9a-zA-Z]*)|(0)");
}
namespace detail namespace detail
{ {
@ -501,6 +496,8 @@ namespace cxxopts
integer_parser(const std::string& text, T& value) integer_parser(const std::string& text, T& value)
{ {
std::smatch match; std::smatch match;
std::basic_regex<char> integer_pattern
("(-)?(0x)?([1-9a-zA-Z][0-9a-zA-Z]*)|(0)");
std::regex_match(text, match, integer_pattern); std::regex_match(text, match, integer_pattern);
if (match.length() == 0) if (match.length() == 0)