| 242 | } |
| 243 | |
| 244 | bool RegexMatchAll(std::vector<std::string> const& args, |
| 245 | cmExecutionStatus& status) |
| 246 | { |
| 247 | //"STRING(REGEX MATCHALL <regular_expression> <output variable> <input> |
| 248 | // [<input>...])\n"; |
| 249 | try { |
| 250 | std::string const& regex = args[2]; |
| 251 | std::string const& outvar = args[3]; |
| 252 | cm::CMakeString data{ cmMakeRange(args).advance(4) }; |
| 253 | |
| 254 | auto result = data.Match(regex, cm::CMakeString::MatchItems::All, |
| 255 | &status.GetMakefile()); |
| 256 | // Store the result in the provided variable. |
| 257 | status.GetMakefile().AddDefinition(outvar, result.to_string()); |
| 258 | return true; |
| 259 | } catch (std::exception const& e) { |
| 260 | status.SetError( |
| 261 | cmStrCat("sub-command REGEX, mode MATCHALL: ", e.what(), '.')); |
| 262 | return false; |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | bool RegexReplace(std::vector<std::string> const& args, |
| 267 | cmExecutionStatus& status) |
no test coverage detected
searching dependent graphs…