以下のような混沌としたログ出力があります(はい、それらの奇妙な新しい行が実際にそれらの場所に存在します.:)
C:\testing\testpath\testfile.txt
\\1.2.3.4\c$\test\testpath1\testpath2\k
\\1.2.3.4\c$\test\testpath1\testpath2\
C:\ro\row\rou\line.txt:line 234
Failed to grant AssetID=33683041 to UserID=44129434: Recipient already owns Asset at Corp.UserAsset.AwardUserAsset(Int6
4 assetReferenceId, Int32 userId, Boolean preventDuplicates, Boolean& awardedNewAsset)
in d:\workspace\Trunk\Assemblies\SCL\CCL\BLL\UserAsset.cs:line 723 at Corp.UserAsset.AwardUserAsset(Int64 assetReferenceId, Int32 userId, Boolean preventDuplicates) in d:\workspace\Trunk\Assemblies\SCL\CCL\BLL\UserAsset.cs:line 710 at Corp.Website.Badge.Award.ProcessRequest(HttpContext context) in d:\workspace\Trunk\Web\CorpWebSite\Badge\Award.ashx.cs:line 111 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
正規表現から取得したいのは、次のようなものです。
C:\testing\testpath\testfile.txt
\\1.2.3.4\c$\test\testpath1\testpath2\k
\\1.2.3.4\c$\test\testpath1\testpath2\
C:\ro\row\rou\line.txt:line 234
d:\workspace\Trunk\Assemblies\SCL\CCL\BLL\UserAsset.cs:line 723 at Corp.UserAsset.AwardUserAsset(Int64 assetReferenceId, Int32 userId, Boolean preventDuplicates) in
d:\workspace\Trunk\Assemblies\SCL\CCL\BLL\UserAsset.cs:line 710 at Corp.Website.Badge.Award.ProcessRequest(HttpContext context) in
d:\workspace\Trunk\Web\CorpWebSite\Badge\Award.ashx.cs:line 111 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
現在、次の正規表現があります
([\w]:\\|\\\\)([^\r\n]*)
しかし、結果はそれほどではありません。最初の 4 行を取得していますが、最後のエラー行は 3 行ではなく 1 行として表示されています。