Developer Network
Developer Network
Developer Network
:CreateViewProfileText:
登录
MSDN 订阅
获取工具
下载
Visual Studio
SDK
试用软件
免费下载
Office 资源
计划
订阅
Administrators
学生
Microsoft Imagine
Microsoft 学生合作伙伴
ISV
新手
Events(事件)
社区
Magazine
论坛
博客
第 9 频道
文档
API 和参考
开发人员中心
示例
停用的内容
非常抱歉。你请求的内容已被删除。将在 1 秒内自动重定向。
提出问题
快速访问
论坛主页
浏览论坛用户
FAQ
搜索相关主题
Remove From My Forums
积极答复者
求一正则替换表达式
.NET 开发
>
.NET Framework 一般性问题讨论区
问题
0
登录进行投票
字符串
using system.........
using system.........
......
....
#if debug
button1.text = "aa";
#else
button1.text = "aa".Tolower();
#endif
.....
#if debug
button1.text = "aa";
#else
button1.text = "aa".Tolower();
#endif
.....
把上面的替换成
using system.........
using system.........
......
....
#if debug button1.text = "aa";#else button1.text = "aa".Tolower();#endif
.....
#if debug button1.text = "aa";#else button1.text = "aa".Tolower();#endif
.....
2011年1月5日 11:37
回复
|
引用
答案
0
登录进行投票
string pattern = @"(#if debug)[\s\S]*?(.{2,})[\s\S]*?(#else)[\s\S]*?(.{2,})[\s\S]*?(#endif)";
inStr = Regex.Replace(inStr, pattern, "$1$2$3$4$5");
rtb_2.Text = inStr;
已标记为答案
大访客
2011年1月6日 12:25
2011年1月6日 12:25
回复
|
引用