From 3ca5e6e0a48140cd06db8070f6c38858e424bb56 Mon Sep 17 00:00:00 2001 From: Guido Novati Date: Wed, 27 Mar 2019 22:28:33 +0100 Subject: [PATCH] intel gave me trouble, can we avoid regex? is there an alternative to the line I commented out? --- src/ArgumentParser.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ArgumentParser.cpp b/src/ArgumentParser.cpp index f8a5698..949be69 100644 --- a/src/ArgumentParser.cpp +++ b/src/ArgumentParser.cpp @@ -3,7 +3,9 @@ #include #include #include -#include // C++11 +#include +#include +//#include // C++11 #include "Cubism/ArgumentParser.h" @@ -117,7 +119,9 @@ CommandlineParser::CommandlineParser(const int argc, char **argv) // if the current value is numeric and (possibly) negative, // do not interpret it as a key const bool leadingDash = (argv[j][0] == '-'); - const bool isNumeric = std::regex_match(argv[j], std::regex("(\\+|-)?[0-9]*(\\.[0-9]*)?((e|E)(\\+|-)?[0-9]*)?")); + const char c = argv[j][1]; + const bool isNumeric = ((c>='0' && c<='9') || c==0)? true:false; + // const bool isNumeric = std::regex_match(argv[j], std::regex("(\\+|-)?[0-9]*(\\.[0-9]*)?((e|E)(\\+|-)?[0-9]*)?")); if (leadingDash && !isNumeric) break; else -- GitLab