getting compilation error,saying Only assignment, call, increment, decrement, and new object expressions can be used as a statement and ; Expected. how to count img
tags having no alt
attributes as well as img
tags with an alt
attribute containing an empty string.
Both img
tags below should be counted, but only the second one is counted in my code:
<img src="http://google.com/images/38524_1105/16/geolocate.png" class="absmiddle" alt="" />
<img src="http://google.com/images/38524_1105/16/geolocate.png" class="absmiddle" />
Here's my code (my aspx.cs
file):
MatchCollection ImgAltTag = Regex.Matches(strIn, "<img[^>]*alt=['"].+['"]", RegexOptions.IgnoreCase | RegexOptions.Multiline);