Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/17.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.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 Dreamweaver Regedit搜索和替换_Regex_Dreamweaver_Regedit - Fatal编程技术网

Regex Dreamweaver Regedit搜索和替换

Regex Dreamweaver Regedit搜索和替换,regex,dreamweaver,regedit,Regex,Dreamweaver,Regedit,我目前有1300个HTML实例需要替换。问题是,大约每6个实例都有一个不同的url,用于代码博客中的href标记 在Dreamweaver中,什么是合适的regedit来搜索和替换所有这些内容并忽略不同的URL 要搜索的代码遵循以下格式。段落标记和链接标记内的文本总是相同的。只有href url不同 <p>Some text here <a href="https://mylink.com" target="_blank">Link text</a>.<

我目前有1300个HTML实例需要替换。问题是,大约每6个实例都有一个不同的url,用于代码博客中的href标记

在Dreamweaver中,什么是合适的regedit来搜索和替换所有这些内容并忽略不同的URL

要搜索的代码遵循以下格式。段落标记和链接标记内的文本总是相同的。只有href url不同

<p>Some text here <a href="https://mylink.com" target="_blank">Link text</a>.</p>
这里有一些文本

[a-zA-Z0-9\s]*

这里还有其他一些文字

这里有一些文字

这里有一些文字

虽然不能涵盖所有情况,但这为您提供了一个很好的匹配机会,即使字符串并非全部完美成形


在regex101进行测试

我想这里有一些文本。

就可以了。假设您的
href
都正确关闭,请始终使用双引号,并且不要在其中使用双引号。这取决于您将用什么替换它。如果没有可重复使用的东西,那也没关系。
<p>[a-zA-Z0-9\s]*<a href='?"?(http(s)?:\/\/)?(www.)?\w*[.][a-zA-Z]{2,3}'?"?\s?(target='?"?[_a-zA-Z]{0,8}'?"?)?\s*>[a-zA-Z0-9\s]*<\/a>[.]?<\/p>
<p>Some text here <a href="https://mylink.com" target="_blank">Link text</a>.</p>
<p>Some other text here <a href="mylink.ag" target="_blank">Link text</a>.</p>
<p>Some text here<a href='https://mylink.com' target='_blank'  >Link text</a>.</p>
<p>Some text here <a href='https://mylink2.com' target="_blank">Link text</a></p>