diff --git a/src/DynareFlex.ll b/src/DynareFlex.ll index 7b0d27c7f5616aeb06e2ac55d9d366cd1d7f2b98..7b7c962dd6d350e5660430dbfe2ce6faa3f3f898 100644 --- a/src/DynareFlex.ll +++ b/src/DynareFlex.ll @@ -71,7 +71,7 @@ string eofbuff; #define YY_USER_ACTION location_increment(yylloc, yytext); %} -DATE -?[0-9]+([ya]|m([1-9]|1[0-2])|q[1-4]|w([1-9]{1}|[1-4][0-9]|5[0-2])) +DATE -?[0-9]+([ya]|m([1-9]|1[0-2])|q[1-4]) %% /* Code put at the beginning of yylex() */ diff --git a/src/Statement.cc b/src/Statement.cc index ee1b4e11103c8f5058920f2a902911502e3ea28e..888af54b7645c071497ad964e60500f001f7b939 100644 --- a/src/Statement.cc +++ b/src/Statement.cc @@ -1,5 +1,5 @@ /* - * Copyright © 2006-2019 Dynare Team + * Copyright © 2006-2020 Dynare Team * * This file is part of Dynare. * @@ -53,7 +53,7 @@ void NativeStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const { using namespace boost::xpressive; - string date_regex = R"((-?\d+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4]\d|5[0-2]))))"; + string date_regex = R"((-?\d+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4])))"; sregex regex_lookbehind = sregex::compile(R"((?<!\$|\d|[a-zA-Z_]|\'))" + date_regex); sregex regex_dollar = sregex::compile(R"((\$))"+date_regex);