mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-07-29 10:02:48 +00:00
rollback regex
crashes
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
#include "emsesp.h"
|
||||
|
||||
#include "shuntingYard.h"
|
||||
#include <regex>
|
||||
// #include <regex>
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
@@ -334,9 +334,8 @@ std::deque<Token> shuntingYard(const std::deque<Token> & tokens) {
|
||||
|
||||
// check if string is a number
|
||||
bool isnum(const std::string & s) {
|
||||
std::regex r("^[+-]?(\\d+\\.?\\d*)$");
|
||||
return std::regex_match(s, r);
|
||||
/*
|
||||
// std::regex r("^[+-]?(\\d+\\.?\\d*)$");
|
||||
// return std::regex_match(s, r);
|
||||
if (s.empty() || s.find_first_of("0123456789") == std::string::npos) {
|
||||
return false;
|
||||
}
|
||||
@@ -344,7 +343,6 @@ bool isnum(const std::string & s) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
@@ -833,4 +831,4 @@ std::string compute(const std::string & expr) {
|
||||
return calculate(expr_new);
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
} // namespace emsesp
|
||||
|
||||
Reference in New Issue
Block a user