Commit 63af78443b2bb2e8c12941230bf69eb268d7fde3
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 | 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 | ... | ... |