Add support for alphanumeric options

This commit is contained in:
Baptiste Wicht 2014-10-26 19:12:32 +01:00
parent 9b3d20d611
commit 63af78443b

View File

@ -497,10 +497,10 @@ namespace cxxopts
constexpr int OPTION_DESC_GAP = 2;
std::basic_regex<char> option_matcher
("--([[:alpha:]][-_[:alpha:]]+)(=(.*))?|-([a-zA-Z]+)");
("--([[:alnum:]][-_[:alnum:]]+)(=(.*))?|-([a-zA-Z]+)");
std::basic_regex<char> option_specifier
("(([a-zA-Z]),)?([a-zA-Z][-_a-zA-Z]+)");
("(([a-zA-Z]),)?([a-zA-Z0-9][-_a-zA-Z0-9]+)");
std::string
format_option