fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text.RegularExpressions;
  6.  
  7. public class Test
  8. {
  9. public static void Main()
  10. {
  11. var text = @"ExampleProjectSystem.API.Services.ReportRepository.SearchCustomerByAdvanceFilters(TableBaseDto filter, String ReportName) in E:\SharedProjects\ExampleProjectAPI\Services\ReportRepository.cs:line 445";
  12. var pattern = @"([^\s\\]+):line\s+(\d+)";
  13. var result = Regex.Match(text, pattern);
  14. if (result.Success)
  15. {
  16. Console.WriteLine(result.Groups[1].Value);
  17. Console.WriteLine(result.Groups[2].Value);
  18. }
  19. }
  20. }
Success #stdin #stdout 0.06s 29244KB
stdin
Standard input is empty
stdout
ReportRepository.cs
445