by jkeen
23. July 2009 11:56
要求:
找C#代码,非注释代码中执行了GetLabel()函数的地方,GetLabel函数有一个以上参数,只需要找出第一个参数用了变量而不是直接用字符串的代码。
匹配条件(举例):
case 1) --符合
string resourceid = "UserName";
string userName = this.GetLabel(resourceid);
case 2) --不符合
string username = this.GetLabel("UserName"); -- 不符合
case 3) --不符合
// string userName = this.GetLabel(MESSAGE_UserName);
case 4) --不符合
/*
string userName = this.GetLabel(MESSAGE_UserName);
*/
case 5) --符合
string resourceid = "UserName";
string UserName = this.GetLabel(resourceid + "_ID");
case 6) --符合
string resourceid = "UserName";
string UserName = this.GetLabel(resourceid,this.LangCode);
可能还有其他Case,但要求就是所有调用GetLabel函数的第一个参数为非字符串的代码文件。
感兴趣的同事,请帮忙写一下这个正则表达式。谢谢!
9eec5f04-22ed-4787-aae0-826f206e264a|0|.0
Tags: 正则表达式
问题征答