using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"night (.*)|Total(.*)";
string input = @"<strong class=""price scarcity_color sr_gs_rackrate_price
anim_rack_rate
"" title=""Price for 1 night £69"">
<b>
<span class=""sr_gs_rackrate_total"">Total: </span>
£69
</b>
</strong>
<td class=""totalPrice"" colspan=""3"">
<div data-component=""track"" data-hash=""OLNYSRfCbdWGffSRe"" data-stage=""1"" data-track=""view""></div>
Total: £145
</td>";
RegexOptions options = RegexOptions.Multiline | RegexOptions.IgnoreCase;
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