using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"failing[\w\W]*?\d*\)\s[\w\W]*?\:[\s\S]*?(Assert[\w\W]*?)[\n].*(src[^:]+):(\d+):(\d+)";
string input = @" 1) validates input
0 passing (660ms)
1 failing
1) statement:propose validates input:
AssertionError: expected { Object (status, err) } to have a deep property 'err' of 'err1', but got 'Error while fetching the changes from the event store: {}'
at doAsserterAsyncAndAddThen (node_modules/chai-as-promised/lib/chai-as-promised.js:307:16)
at .<anonymous> (node_modules/chai-as-promised/lib/chai-as-promised.js:255:21)
at ctx.(anonymous function) [as property]
at src/aggregate/index.js:144:100
(node_modules/chai/lib/chai/utils/overwriteMethod.js:49:33)
at Context.<anonymous> (src/aggregate/test/index.js:44:36)
";
foreach (Match m in Regex.Matches(input, pattern))
{
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