@@ -21,48 +21,47 @@ internal partial class StackFrame
21
21
private const string Space = @"[\x20\t]" ;
22
22
private const string NotSpace = @"[^\x20\t]" ;
23
23
24
- private static readonly Regex Pattern =
25
- new (
26
- $$ """
27
- ^
28
- {{ Space }} *
29
- \w+ {{ Space }} +
30
- (?<frame>
31
- (?<type> {{ NotSpace }} + ) \.
32
- (?<method> {{ NotSpace }} +? ) {{ Space }} *
33
- (?<params> \( ( {{ Space }} * \)
34
- | (?<pt> .+?) {{ Space }} + (?<pn> .+?)
35
- (, {{ Space }} * (?<pt> .+?) {{ Space }} + (?<pn> .+?) )* \) ) )
36
- ( {{ Space }} +
37
- ( # Microsoft .NET stack traces
38
- \w+ {{ Space }} +
39
- (?<file> ( [a-z] \: # Windows rooted path starting with a drive letter
40
- | / ) # Unix rooted path starting with a forward-slash
41
- .+? )
42
- \: \w+ {{ Space }} +
43
- (?<line> [0-9]+ ) \p{P}?
44
- | # Mono stack traces
45
- \[0x[0-9a-f]+\] {{ Space }} + \w+ {{ Space }} +
46
- <(?<file> [^>]+ )>
47
- :(?<line> [0-9]+ )
48
- )
49
- )?
50
- )
51
- \s*
52
- $
53
- """ ,
54
- RegexOptions . IgnoreCase
55
- | RegexOptions . Multiline
56
- | RegexOptions . ExplicitCapture
57
- | RegexOptions . CultureInvariant
58
- | RegexOptions . IgnorePatternWhitespace
59
- | RegexOptions . Compiled ,
60
- // Cap the evaluation time to make it obvious should the expression
61
- // fall into the "catastrophic backtracking" trap due to over
62
- // generalization.
63
- // https://github.com/atifaziz/StackTraceParser/issues/4
64
- TimeSpan . FromSeconds ( 5 )
65
- ) ;
24
+ private static readonly Regex Pattern = new (
25
+ $$ """
26
+ ^
27
+ {{ Space }} *
28
+ \w+ {{ Space }} +
29
+ (?<frame>
30
+ (?<type> {{ NotSpace }} + ) \.
31
+ (?<method> {{ NotSpace }} +? ) {{ Space }} *
32
+ (?<params> \( ( {{ Space }} * \)
33
+ | (?<pt> .+?) {{ Space }} + (?<pn> .+?)
34
+ (, {{ Space }} * (?<pt> .+?) {{ Space }} + (?<pn> .+?) )* \) ) )
35
+ ( {{ Space }} +
36
+ ( # Microsoft .NET stack traces
37
+ \w+ {{ Space }} +
38
+ (?<file> ( [a-z] \: # Windows rooted path starting with a drive letter
39
+ | / ) # Unix rooted path starting with a forward-slash
40
+ .+? )
41
+ \: \w+ {{ Space }} +
42
+ (?<line> [0-9]+ ) \p{P}?
43
+ | # Mono stack traces
44
+ \[0x[0-9a-f]+\] {{ Space }} + \w+ {{ Space }} +
45
+ <(?<file> [^>]+ )>
46
+ :(?<line> [0-9]+ )
47
+ )
48
+ )?
49
+ )
50
+ \s*
51
+ $
52
+ """ ,
53
+ RegexOptions . IgnoreCase
54
+ | RegexOptions . Multiline
55
+ | RegexOptions . ExplicitCapture
56
+ | RegexOptions . CultureInvariant
57
+ | RegexOptions . IgnorePatternWhitespace
58
+ | RegexOptions . Compiled ,
59
+ // Cap the evaluation time to make it obvious should the expression
60
+ // fall into the "catastrophic backtracking" trap due to over
61
+ // generalization.
62
+ // https://github.com/atifaziz/StackTraceParser/issues/4
63
+ TimeSpan . FromSeconds ( 5 )
64
+ ) ;
66
65
67
66
public static IEnumerable < StackFrame > ParseMany ( string text ) =>
68
67
from Match m in Pattern . Matches ( text )
0 commit comments