我使用PCRE.NET(Perl兼容的正则表达式for .NET)lib。我有一个有趣的错误,有两个应用程序。一个是Asp.net APP,另一个是Console APP。我的控制台APP工作正常,但Asp.net APP给出错误(Stackoverflow)
我可以为Asp.net App做些什么?
控制台APP:
static void Main(string[] args)
{
string test = "";
using (var streamReader = new StreamReader(@"c:\file.txt", Encoding.UTF8))
{
test = streamReader.ReadToEnd();
}
var matches = PcreRegex.Matches(test, @"(\/\*(?:(?!\/\*).|(?1))*?\*\/)(*SKIP)(*F)|^\s*CREATE |^\s*ALTER |^\s*DROP |^\s*GRANT ", PcreOptions.MultiLine | PcreOptions.Singleline | PcreOptions.IgnoreCase).ToList();
}
Asp.Net APP:
protected void Page_Load(object sender, EventArgs e)
{
string test = "";
using (var streamReader = new StreamReader(@"c:\file.txt", Encoding.UTF8))
{
test = streamReader.ReadToEnd();
}
var matches = PcreRegex.Matches(test, @"(\/\*(?:(?!\/\*).|(?1))*?\*\/)(*SKIP)(*F)|^\s*CREATE |^\s*ALTER |^\s*DROP |^\s*GRANT ", PcreOptions.MultiLine | PcreOptions.Singleline | PcreOptions.IgnoreCase).ToList();
}
错误:
420cc350a653e64458da2ef4f8e4ac89.dll发生未处理的“System.StackOverflowException”类型异常
最好的问候