Commit 1124d00de50afe1df095c19729c4a55d24577f6d

Authored by jarro2783
2 parents 9b3d20d6 63af7844

Merge pull request #6 from wichtounet/alnum_options

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 497 constexpr int OPTION_DESC_GAP = 2;
498 498  
499 499 std::basic_regex<char> option_matcher
500   - ("--([[:alpha:]][-_[:alpha:]]+)(=(.*))?|-([a-zA-Z]+)");
  500 + ("--([[:alnum:]][-_[:alnum:]]+)(=(.*))?|-([a-zA-Z]+)");
501 501  
502 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 505 std::string
506 506 format_option
... ...