using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?<txt_pre_linka>\w+)?(?<ceo_link><a .*?>.*?<\/a>)(?<txt_after_linka>.*?)(?=<a .*?>.*?<\/a>|$|\.)";
string input = @"ECSE-4530 Digital Signal Processing
Rich Radke, Rensselaer Polytechnic Institute
Lecture 5: the Fourier Transform (9/11/14)
shsdhsh<a class=""yt-simple href=""/watch?v=5HSn3DPHQcQ&t=2s"">0:00:02</a> The Fourier Transform.
Shshshsh<a class=""yt-simple"" href=""/watch?v=5HSn3DPHQcQ&t=219s"">0:03:39</a> Thinking ofles of a function
shgshshshs<a class=""yt-simple"" href=""/watch?v=5HSn3DPHQcQ&t=463s"">0:07:43</a> Derivim aiod goes to infinity";
RegexOptions options = RegexOptions.Singleline;
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