Skip to content

Commit

Permalink
Merge pull request #3251 from stan-dev/regex-bugfix
Browse files Browse the repository at this point in the history
[BUGFIX] Replace STL regex with Boost for MinGW bug
  • Loading branch information
syclik authored Jan 18, 2024
2 parents 979e7a6 + 84a151e commit 9c30bdd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/stan/io/json/json_data_handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <utility>
#include <vector>
#include <boost/algorithm/string.hpp>
#include <regex>
#include <boost/regex.hpp>

namespace stan {

Expand Down Expand Up @@ -172,8 +172,8 @@ class json_data_handler : public stan::json::json_handler {
* and contain only letters, numbers, or an underscore.
*/
bool valid_varname(const std::string& name) {
static const std::regex re("[a-zA-Z][a-zA-Z0-9_]*");
return std::regex_match(name, re);
static const boost::regex re("[a-zA-Z][a-zA-Z0-9_]*");
return boost::regex_match(name, re);
}

bool is_array_tuples(const std::vector<std::string>& keys) {
Expand Down

0 comments on commit 9c30bdd

Please sign in to comment.