Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/visual-studio/8.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 在Visual Studio中查找并替换正则表达式_Regex_Visual Studio_Visual Studio 2013_Replace - Fatal编程技术网

Regex 在Visual Studio中查找并替换正则表达式

Regex 在Visual Studio中查找并替换正则表达式,regex,visual-studio,visual-studio-2013,replace,Regex,Visual Studio,Visual Studio 2013,Replace,我正在使用Visual Studio 2013,并尝试使用以下语法查找和替换方法调用: 查找内容: TakeAndCompareScreenshot(.*); 替换为: TakeAndCompareScreenshot(.*); \n Upgrade_CommonMethods.Errorfinder(driver);** 请帮我解决这个问题

我正在使用Visual Studio 2013,并尝试使用以下语法查找和替换方法调用:

查找内容:

  TakeAndCompareScreenshot(.*);
替换为:

  TakeAndCompareScreenshot(.*); \n                                                                     
  Upgrade_CommonMethods.Errorfinder(driver);** 
请帮我解决这个问题

我只需要添加
Upgrad\u CommonMethods.Errorfinder(驱动程序)在下面的所有
截取和比较屏幕(.*)行,无任何值更改

这可能吗?在Visual Studio 2013或记事本++中


在替换为中,不要重复使用
(.*)
,而是使用捕获组:。还要注意,
是正则表达式中的特殊字符,需要在搜索模式中使用
\(
\)
进行转义

搜索:

TakeAndCompareScreenshot\((.*)\);
替换(
$0
包含搜索捕获的整个字符串):

或者(
$1
包含
(..)
之间的第一项内容):


在替换为中,不要重复使用
(.*)
,而是使用捕获组:。另外请注意,
是正则表达式中的特殊字符,需要在搜索模式中使用
\(
\)
进行转义。嗨,jesse buddy,谢谢,它的工作不会失败,
$0\n     Upgrade_CommonMethods.Errorfinder(driver);
TakeAndCompareScreenshot($1);\n    Upgrade_CommonMethods.Errorfinder(driver);