$re = '/\d+-\d+-\d+T\d+:\d+:\d+\.\d+\+\d+:\d+ stdout F \[\d+mERROR\[\d+m\[\d+mnetwork_costs_rs::classifier::networkffds_classifier\[\d+m\[\d+m:\[\d+m Could not locate region for local node:/m';
$str = '2024-06-15T12:36:58.798794309+03:30 stdout F [21mERROR[333m[1112mnetwork_costs_rs::classifier::networkffds_classifier[0m[2m:[0m Could not locate region for local node:';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php