I have this file that contains the following text (html):
<tr>
<th scope="row">X:</th>
<td>343</td>
</tr>
<tr>
<th scope="row">Y:</th>
<td>6,995 sq ft / 0.16 acres</td>
</tr>
And I have this method to read the values from X,Y
private static Dictionary<string, string> FindKeys(IEnumerable<string> keywords, string source)
{
var found = new Dictionary<string, string>();
var keys = string.Join("|", keywords.ToArray());
var matches = Regex.Matches(source, @"\b(?<key>" + keys + @"):\s*(?<value>)");
foreach (Match m in matches)
{
try
{
var key = m.Groups["key"].ToString();
var value = m.Groups["value"].ToString();
found.Add(key, value);
}
catch
{
}
}
return found;
}
I can't get the method to return the values from X,Y
Any thing wrong in the regex expression?