fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. string pattern = @"(?m)\r?\n^(?!""2018)";
  9. string substitution = @"";
  10. string input = @"""2018-02-22 10:06:10,857"",""[7]"","" ERROR"",""MyApp.Web.Infrastructure.ErrorResponseCommand"",""ErrorResponseCMD logs Controller: webinar | Action: Index"",""""
  11. ""2018-02-22 10:06:37,742"",""[11]"","" INFO "",""MyApp.Web.MvcApplication"",""Anon Session Starts with: {""""FirstPage"""": """"https://w...content-available-to-author-only...s.com/wp-login.php"""", """"QueryString"""": """""""", """"SessionId"""": """"uhnev2dnds33dastwrdgftvm"""", """"FirstCookies"""": {""""CookieName"""": """"ASP.NET_SessionId"""", """"Value"""": """"uhnev2dnds33dastwrdgftvm""""}}"",""""
  12. ""2018-02-22 10:06:48,053"",""[11]"","" INFO "",""MyApp.Web.Controllers.CartController"",""SessionInfo{
  13. """"FirstPage"""": null,
  14. """"RemoteAddress"""": """"207.46.13.159"""",
  15. """"RemoteHost"""": """"207.46.13.159"""",
  16. """"RemoteUser"""": """""""",
  17. RelativeConfirmPasswordResetUrl:Account/PasswordResetConfirm
  18. //and other non-predictable BOL patterns.
  19. },""""
  20. ""2018-02-22 10:06:10,857"",""[7]"","" ERROR"",""MyApp.Web.Infrastructure.ErrorResponseCommand"",""ErrorResponseCMD logs Controller: webinar | Action: Index"",""""
  21. ";
  22. Regex regex = new Regex(pattern);
  23. string result = regex.Replace(input, substitution);
  24. Console.WriteLine(result);
  25. }
  26. }
Success #stdin #stdout 0.06s 19672KB
stdin
Standard input is empty
stdout
"2018-02-22 10:06:10,857","[7]"," ERROR","MyApp.Web.Infrastructure.ErrorResponseCommand","ErrorResponseCMD logs Controller: webinar | Action: Index",""
"2018-02-22 10:06:37,742","[11]"," INFO ","MyApp.Web.MvcApplication","Anon Session Starts with: {""FirstPage"": ""https://w...content-available-to-author-only...s.com/wp-login.php"", ""QueryString"": """", ""SessionId"": ""uhnev2dnds33dastwrdgftvm"", ""FirstCookies"": {""CookieName"": ""ASP.NET_SessionId"", ""Value"": ""uhnev2dnds33dastwrdgftvm""}}",""
"2018-02-22 10:06:48,053","[11]"," INFO ","MyApp.Web.Controllers.CartController","SessionInfo{  ""FirstPage"": null,  ""RemoteAddress"": ""207.46.13.159"",  ""RemoteHost"": ""207.46.13.159"",  ""RemoteUser"": """",RelativeConfirmPasswordResetUrl:Account/PasswordResetConfirm//and other non-predictable BOL patterns.},""
"2018-02-22 10:06:10,857","[7]"," ERROR","MyApp.Web.Infrastructure.ErrorResponseCommand","ErrorResponseCMD logs Controller: webinar | Action: Index",""