正则表达式,用于在Visual Studio项目中查找包含标记但不包含标记的文件 [英] Regex for find files which contain tag but not contain tag in visual studio project

查看:97
本文介绍了正则表达式,用于在Visual Studio项目中查找包含标记但不包含标记的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好专家!



我想搜索标准使用

正则表达式查找所有文件

包含 word1 ,但

在visual studio项目中不包含 word2





请帮助

Hello experts!

I want to search criteria using
Regex for find all files which
contain word1 but
not contain word2
in visual studio project

please help

推荐答案

所以使用两个正则表达式:

So use two regexes:
if (Regex.Match(inputfiletext, "word1").Success && !Regex.Match(inputfiletext, "word2").Success)
   {
   ...
   }


这篇关于正则表达式,用于在Visual Studio项目中查找包含标记但不包含标记的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆