Commit 63af78443b2bb2e8c12941230bf69eb268d7fde3

Authored by Baptiste Wicht
1 parent 9b3d20d6

Add support for alphanumeric options

Showing 1 changed file with 2 additions and 2 deletions
src/cxxopts.hpp
@@ -497,10 +497,10 @@ namespace cxxopts @@ -497,10 +497,10 @@ namespace cxxopts
497 constexpr int OPTION_DESC_GAP = 2; 497 constexpr int OPTION_DESC_GAP = 2;
498 498
499 std::basic_regex<char> option_matcher 499 std::basic_regex<char> option_matcher
500 - ("--([[:alpha:]][-_[:alpha:]]+)(=(.*))?|-([a-zA-Z]+)"); 500 + ("--([[:alnum:]][-_[:alnum:]]+)(=(.*))?|-([a-zA-Z]+)");
501 501
502 std::basic_regex<char> option_specifier 502 std::basic_regex<char> option_specifier
503 - ("(([a-zA-Z]),)?([a-zA-Z][-_a-zA-Z]+)"); 503 + ("(([a-zA-Z]),)?([a-zA-Z0-9][-_a-zA-Z0-9]+)");
504 504
505 std::string 505 std::string
506 format_option 506 format_option