using System.Diagnostics;
using System.Text.RegularExpressions;
public static void Main()
var sw = Stopwatch.StartNew();
for(var i = 0; i < 10000; i++)
var html = "<p><strong>Question #19</strong></p>" +
"<p><strong>NOTE: The following instructions will be used for questions 16 through 20, and the same instructions will be included for each question.</strong></p>" +
"<p><strong><img alt=\"\" height=\"488\" src=\"/Files/Images/9213/c57aac1d-b938-41e2-961d-980bff732baa.jpg\" width=\"563\" /></strong></p>" +
"<p><strong>Question:</strong></p><p>Carry out the instructions assuming only bulb 4 is initially on. When you stop in step 6, what is the result?</p>" + i.ToString();
html = Regex.Replace(html, "(?<=<img.*?src=\")(/files/resources/.*?)(?=\".*?>)", $"XYZ$&", RegexOptions.IgnoreCase);
Console.WriteLine(sw.ElapsedMilliseconds);