using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"\bdetails:.*?(\/.*?\.png\b)";
string substitution = @"$1/";
string input = @"'\u001b[1m\u001b[31m \u001b[1m● \u001b[1mregister page › register-automated › desktop › CONTROL\u001b[39m\u001b[22m\n\n Expected image to match or be a close match to snapshot but was 0.009980258828690502% different from snapshot (91 differing pixels).\n \u001b[1m\u001b[31mSee diff for details:\u001b[39m\u001b[22m \u001b[31m/src/pages/__image_snapshots__/__diff_output__/register-test-js-register-page-register-automated-desktop-control-1-diff.png\u001b[39m\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 60 | \u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 61 | \u001b[39m \u001b[36mconst\u001b[39m image \u001b[33m=\u001b[39m await page\u001b[33m.\u001b[39mscreenshot({ fullPage\u001b[33m:\u001b[39m isFullPage })\u001b[33m;\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m\u001b[31m\u001b[1m>\u001b[2m\u001b[39m\u001b[90m 62 | \u001b[39m expect(image)\u001b[33m.\u001b[39mtoMatchImageSnapshot({threshold\u001b[33m:\u001b[39m \u001b[35m0.3\u001b[39m})\u001b[33m;\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m | \u001b[39m \u001b[31m\u001b[1m^\u001b[2m\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 63 | \u001b[39m })\u001b[33m;\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 64 | \u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 65 | \u001b[39m \u001b[36mif\u001b[39m(experimentName \u001b[33m||\u001b[39m experiementVariationName) {\u001b[0m\u001b[22m\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object.toMatchImageSnapshot (\u001b[2msrc/command/getPageImageShot.js\u001b[2m:62:25)\u001b[2m\u001b[22m\n'
";
RegexOptions options = RegexOptions.Multiline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
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