--- src/cxxopts.hpp.orig 2017-08-15 21:35:19.000000000 -0400 +++ src/cxxopts.hpp 2017-08-17 10:27:46.388968882 -0400 @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include @@ -852,10 +852,10 @@ constexpr int OPTION_LONGEST = 30; constexpr int OPTION_DESC_GAP = 2; - std::basic_regex option_matcher + boost::basic_regex option_matcher ("--([[:alnum:]][-_[:alnum:]]+)(=(.*))?|-([[:alnum:]]+)"); - std::basic_regex option_specifier + boost::basic_regex option_specifier ("(([[:alnum:]]),)?([[:alnum:]][-_[:alnum:]]+)"); String @@ -979,10 +979,9 @@ std::string arg_help ) { - std::match_results result; - std::regex_match(opts.c_str(), result, option_specifier); + boost::match_results result; - if (result.empty()) + if (!boost::regex_match(opts.c_str(), result, option_specifier)) { throw invalid_option_format_error(opts); } @@ -1122,10 +1121,9 @@ break; } - std::match_results result; - std::regex_match(argv[current], result, option_matcher); + boost::match_results result; - if (result.empty()) + if (!boost::regex_match(argv[current], result, option_matcher)) { //not a flag .