I have been trying to extract a single value from some HTML data, but I haven't been able to focus on exactly the piece I am looking for:
The line I am trying to read from is:
<span class="temp">5</span>
There are many other "span" tags with different classes, so I need to only accept "temp" class, and then get the value?
I really have no experience with Regex, but have been trying to figure it out. Here are just some of the lines I have tried:
//MatchCollection data = Regex.Matches(searchData, @"<span class=""temp"">(.+?)<", RegexOptions.None);
//MatchCollection data = Regex.Matches(searchData, @"<span class=""temp"">\s*(.+?)\s*</span>", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"<span class=""temp""> (.*?) </span> ", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"<span class=""temp"">(([^<]|<[^\/]|<\/[^s]|<\/s[^p]|<\/sp[^a]|<\/spa[^n]|<\/span[^ \t >])*)</span>", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"<span class=""temp"">\s*([^<])\s*</span>", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"<span class=""temp"">\s*(<.*?>) * ([^<] *)\s*</span>", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"(?<=<span\s *class=""temp""[^><]*>\s*)[^<>]*", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"(?<=<span\s*class=""temp""[^><]*>\s*)[^<>]*", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"(?<=<span\s*class=""temp"">\s*)*", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"<span[^>] *> (.*?) </ span>", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"<span class=""temp""></span>", RegexOptions.Singleline);
//MatchCollection data = Regex.Matches(searchData, @"<span class=""temp""></span>", RegexOptions.Singleline);
Thank you for any assistance you can provide! Doug