我想在读取的字段数据中,截取第一个图片的路径/upshop/201109/24100019201.jpg,请问如何截取啊
<p>
龙年买恐龙</p>
<p style="text-align: center">
<img alt="恐龙" src="/upshop/201109/24100019201.jpg" style="width: 550px; height: 413px" /></p>
<p style="text-align: center">
<img alt="恐龙" src="/upshop/201109/24100019592.jpg" style="width: 600px; height: 450px" /></p>
<p style="text-align: center">
<img alt="恐龙" src="/upshop/201109/24100019543.jpg" style="width: 600px; height: 450px" /></p>
<p style="text-align: center">
<img alt="恐龙" src="/upshop/201109/24100019934.jpg" style="width: 550px; height: 413px" /></p>
<p style="text-align: center">
</p>
------解决方案--------------------------------------------------------
- C# code
string input = @"<p> 龙年买恐龙</p><p style=""text-align: center""> <img alt=""恐龙"" src=""/upshop/201109/24100019201.jpg"" style=""width: 550px; height: 413px"" /></p><p style=""text-align: center""> <img alt=""恐龙"" src=""/upshop/201109/24100019592.jpg"" style=""width: 600px; height: 450px"" /></p><p style=""text-align: center""> <img alt=""恐龙"" src=""/upshop/201109/24100019543.jpg"" style=""width: 600px; height: 450px"" /></p><p style=""text-align: center""> <img alt=""恐龙"" src=""/upshop/201109/24100019934.jpg"" style=""width: 550px; height: 413px"" /></p><p style=""text-align: center""> </p>"; Regex rgx = new Regex(@"(?is)(?<=src="")[^""]+?(?="")"); Console.WriteLine(rgx.Match(input));
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
------解决方案--------------------------------------------------------
<p>
龙年买恐龙</p>
<p style="text-align: center">
<img alt="恐龙" src="/upshop/201109/24100019201.jpg" style="width: 550px; height: 413px" /></p>
<p style="text-align: center">
<img alt="恐龙" src="/upshop/201109/24100019592.jpg" style="width: 600px; height: 450px" /></p>
<p style="text-align: center">
<img alt="恐龙" src="/upshop/201109/24100019543.jpg" style="width: 600px; height: 450px" /></p>