16 std::string pattern =
"(^|[^a-zA-Z0-9_])\\[(.*?)\\]";
17 std::regex regular_expression(pattern);
20 while (std::regex_search(text, match, regular_expression)) {
21 if ( match[2].str().contains(
"[") ) {
22 throw std::runtime_error(
"Nested collections are not supported");
24 std::vector<double> collection;
25 for (
auto value : strutil::split(match[2].str(),
',') ) {
28 collection.push_back(
false );
31 collection.push_back(
true );
36 collection.push_back( std::stod(value) );
39 throw std::runtime_error(
"BPMNOS: illegal value '" + value +
"' in '" + text +
"'");
47 size_t startPos = (size_t)match.position(2)-1;
48 size_t length = (size_t)match.length(2)+2;
49 text.replace(startPos, length, std::to_string(
id));