[Solved] Search for something in HTML C# [duplicate]


Simple regexp will help you.

You are looking for something start with with http and ending with 720.mp4

The example code:

string strRegex = @"http.*720.mp4";
RegexOptions myRegexOptions = RegexOptions.None;
Regex myRegex = new Regex(strRegex, myRegexOptions);
string strTargetString = @"<html> " + "\n" + @"    ....." + "\n" + @"    <script>" + "\n" + @"        {" + "\n" + @"           http:\\\/\\\/cs513404v4.vk.me\\\/u3692175\\\/videos\\\/49a2e8d28c.720.mp4 " + "\n" + @"        }" + "\n" + @"        ....." + "\n" + @"    </script>" + "\n" + @"  </html>";

foreach (Match myMatch in myRegex.Matches(strTargetString))
{
  if (myMatch.Success)
  {
    // Add your code here
  }
}

6

solved Search for something in HTML C# [duplicate]