i have this :
<img src="http://MyUrl.JPG.jpg" width="180" ...
and i need this :
http://MyUrl.JPG.jpg
thank
i have this :
<img src="http://MyUrl.JPG.jpg" width="180" ...
and i need this :
http://MyUrl.JPG.jpg
thank
Complete solution with regex :
string source ="<img src=\"http://MyUrl.JPG.jpg\"";
var reg = new Regex("src=(?:\"|\')?(?<imgSrc>[^>]*[^/].(?:jpg|bmp|gif|png))(?:\"|\')?");
var match=reg.Match(source);
if(match.Success)
{
var encod = match.Groups["imgSrc"].Value;
}
If that's really all you have you might get away with a regular expression, like
src="([^"]+)
However, you can't and shouldn't try to parse HTML in general with regular expressions. Using regular expressions to parse HTML: why not?
Instead use an HTML parser like Html Agility Pack. I don't know if it's available for WP7, though.