From 63af78443b2bb2e8c12941230bf69eb268d7fde3 Mon Sep 17 00:00:00 2001 From: Baptiste Wicht Date: Sun, 26 Oct 2014 19:12:32 +0100 Subject: [PATCH] Add support for alphanumeric options --- src/cxxopts.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cxxopts.hpp b/src/cxxopts.hpp index f3908c6..073e39c 100644 --- a/src/cxxopts.hpp +++ b/src/cxxopts.hpp @@ -497,10 +497,10 @@ namespace cxxopts constexpr int OPTION_DESC_GAP = 2; std::basic_regex option_matcher - ("--([[:alpha:]][-_[:alpha:]]+)(=(.*))?|-([a-zA-Z]+)"); + ("--([[:alnum:]][-_[:alnum:]]+)(=(.*))?|-([a-zA-Z]+)"); std::basic_regex 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