$re = '/^(.+):(\d+):(\d+):\s(\w\d+)\s(.+)$/m';
$str = '> Executing task: ament_flake8 src/ <
src/examples/rclpy/actions/minimal_action_client/examples_rclpy_minimal_action_client/client_cancel.py:38:5: E303 too many blank lines (2)
def goal_response_callback(self, future):
^
src/examples/rclpy/actions/minimal_action_client/examples_rclpy_minimal_action_client/client_cancel.py:52:5: E303 too many blank lines (2)
def feedback_callback(self, feedback):
^
2 E303 too many blank lines (2)
61 files checked
2 errors
\'E\'-type errors: 2';
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