Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 在c中提取字符串中的html img标记#_Regex_String_C# 4.0 - Fatal编程技术网

Regex 在c中提取字符串中的html img标记#

Regex 在c中提取字符串中的html img标记#,regex,string,c#-4.0,Regex,String,C# 4.0,我有一个html代码作为字符串。我需要删除具有特定src属性的img标记 e、 g. 假设我需要找到具有“test”src属性的img标记,并从字符串中删除整个img标记 提前感谢]*> <img\s(?=.*?\btest\b)[^>]*> 试试这个。看演示 正则表达式不是解决这个问题的最佳方法。。。使用html解析器。html敏捷包呢?

我有一个html代码作为字符串。我需要删除具有特定src属性的img标记

e、 g.

假设我需要找到具有“test”src属性的img标记,并从字符串中删除整个img标记

提前感谢

]*>
<img\s(?=.*?\btest\b)[^>]*>
试试这个。看演示


正则表达式不是解决这个问题的最佳方法。。。使用html解析器。html敏捷包呢?