using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^(.+):(\d+):(\d+):\s(\w\d+)\s(.+)$";
string input = @"> 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";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
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 C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx