运行此代码:C#遗失参考
using System;
using System.Text.RegularExpressions;
namespace WebAutomationDemo
{
public class ExtractDigitsFromString
{
public static void Main(string[] args)
{
string inputData = "No 38, Bunder Garden Street, Perambur, Chennai - 600011";
var data = Regex.Match(inputData, "/s([a - z][A - Z]) +/s -/s/d[6]").Value;
Console.WriteLine(data);
Console.ReadLine();
}
}
}
我得到以下错误:
The type or namespace name '
RegularExpressions
' does not exist in the namespace 'System.Text
' (are you missing an assembly reference?)
这种情况甚至引用System.Text.RegularExpressions
组装后。
即使在引用System.Text.RegularExpressions程序集im面临上述问题plz建议我 –
http://stackoverflow.com/questions/13322798/namespace-of-regex-wont-work –
在您的项目中添加系统引用。 –