using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"<td data-table-header=""The bank [^""]+"">([\d|,|.\+]+)<\/td>";
string input = @"<div class='index-currency-table'>
<!--http://1000hz.github.io/bootstrap-validator/#validator-usage-->
<div class=""row"">
<div class=""col-xs-12"">
<table class=""table--exchange table--exchange--responsive"">
<thead>
<tr>
<th scope=""col"">Currency</th>
<th scope=""col"">Nominal</th>
<th scope=""col"">The bank buys</th>
<th scope=""col"">The bank sells</th>
<th scope=""col"">BNB</th>
</tr>
</thead>
<tbody>
<tr>
<td data-table-header=""Currency"">
<a href=""/en/rates-indexes/currency-rates/USD/"" target=""_self"" title=""United States Dollar"">
<span class=""flag-icon flag-icon-us""></span> USD
</a>
</td>
<td data-table-header=""Nominal"">1</td>
<td data-table-header=""The bank buys"">1.581200</td>
<td data-table-header=""The bank sells"">1.646100</td>
<td data-table-header=""BNB"">1.614390</td>
</tr>
</tbody>
</table>
</div>
<!--col-->
</div>
<!--row-->
</div>";
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