using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"<tr>\n\s*<td width=""70""><strong>Released:<\/strong><\/td>\n\s*<td>(.*)<\/td>\n\s*<\/tr>\n\s*<tr>\n\s*<td width=""70""><strong>Runtime:<\/strong><\/td>\n\s*<td>(.*)<\/td>\n\s*<\/tr>\n\s*<tr>\n\s*<td width=""70""><strong>Genres:<\/strong><\/td>\n\s*<td><span class=""movie_info_genres""><a\s[^<>]*>([^<>]*)<\/a>";
string input = @"<tr>
<td width=""70""><strong>Released:</strong></td>
<td>July 25, 2014</td>
</tr>
<tr>
<td width=""70""><strong>Runtime:</strong></td>
<td>90 mins </td>
</tr>
<tr>
<td width=""70""><strong>Genres:</strong></td>
<td><span class=""movie_info_genres""><a href=""/?genre=Action"">Action</a> <a href=""/?genre=Sci-Fi"">Sci-Fi</a> </span></td>
</tr>
<tr>
<td width=""70""><strong>Actors:</strong></td>
<td><span class=""movie_info_actors"">
<a href=""/?actor_name= Analeigh Tipton ""> Analeigh Tipton </a> <a href=""/?actor_name= Morgan Freeman ""> Morgan Freeman </a> <a href=""/?actor_name= Scarlett Johansson ""> Scarlett Johansson </a> <a href=""/?actor_name=Min-sik Choi"">Min-sik Choi</a> </span></td>
</tr>";
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