今天写了一段程序用于控制台验证正则表达式的
using System;
using System.Text.RegularExpressions;
class RegexMatches
{
public static void Main()
{
Regex expression = new Regex(@"].*/d[0-35-9]-/d/d-/d/d");
string string1 = "June's birthday is 05-12-75/n" + "Dave's birthday is 11-04-68/n" +
"John's birthday is 05-28-73/n" + "Joe's birthday is 12-17-77/n";
foreach (Match myMatch in expression.Matches(string1))
Console.WriteLine(myMatch);
}
}
写成之后编译一直出现
错误 1 命名空间“System.Text”中不存在类型或命名空间名称“RegularExpressions”(是缺少程序集引吗?) E:/C#/TE/TE/RegexMatches.cs 17 19 TE
本人的机器安装的.net Framework 3.5sp1 VS2008专业版
反复检查没有找到错误
好久之后才得以解决
在解决方案管理器里本工程里的引用中添加应用System到本工程中才解决。。。。。。。
有些不是太理解
以前在 WebSite中应用并没有什么问题?