求一个正则表达式~~
<table style= "border-collapse: collapse " bordercolor= "#111111 " cellspacing= "0 " cellpadding= "0 " width= "610 " border= "1 " align= "center ">
<tr>
<td> </td>
</tr>
</table>
</P>
<IMG title= "123 " src=\ "http://192.19.19.43/test.gif " align=left>
</P>
<P> 456 </P>
结果:123456
——————————————
忽略所有html标记 除 <IMG> 的title值
[解决办法]
try
string result = Regex.Replace(yourStr, @ " <img[^> ]*title=([ ' " "]?)(? <title> [^ ' " "]*)\1?[^> ]*> ", "${title} ", RegexOptions.IgnoreCase);
result = Regex.Replace(result, @ "( <[^> ]*> |\s| ) ", " ");
[解决办法]
or
string yourStr = ..............;
string result = Regex.Replace(yourStr, @ "( <img[^> ]*title=([ ' " "]?)(? <title> [^ ' " "]*)\1?[^> ]*> | <[^> ]*> |\s| ) ", "${title} ", RegexOptions.IgnoreCase);