File tree Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Expand file tree Collapse file tree 3 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,8 @@ int count;
81
81
prog->iTimeTaken += finish.QuadPart - start.QuadPart ;
82
82
}
83
83
84
+ prog->m_iMatchAttempts ++; // how many times did we try to match?
85
+
84
86
if (count == PCRE_ERROR_NOMATCH)
85
87
return false ; // no match - don't save matching string etc.
86
88
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ class t_regexp
35
35
m_extra = NULL ;
36
36
iTimeTaken = 0 ;
37
37
m_iCount = 0 ;
38
+ m_iMatchAttempts = 0 ;
38
39
m_iExecutionError = 0 ;
39
40
}; // constructor
40
41
~t_regexp () {
@@ -46,8 +47,9 @@ class t_regexp
46
47
47
48
// pairs of offsets from match
48
49
vector<int > m_vOffsets;
49
- // count of matches
50
+ // count of matching wildcards
50
51
int m_iCount;
52
+ long m_iMatchAttempts;
51
53
// the string we match on (to extract wildcards from)
52
54
string m_sTarget;
53
55
// the program itself
Original file line number Diff line number Diff line change @@ -2280,6 +2280,11 @@ CAlias * alias_item;
2280
2280
}
2281
2281
break ;
2282
2282
2283
+ case 31 :
2284
+ if (alias_item->regexp )
2285
+ SetUpVariantLong (vaResult, alias_item->regexp ->m_iMatchAttempts );
2286
+ break ;
2287
+
2283
2288
case 101 : SetUpVariantString (vaResult, alias_item->wildcards [1 ].c_str ()); break ;
2284
2289
case 102 : SetUpVariantString (vaResult, alias_item->wildcards [2 ].c_str ()); break ;
2285
2290
case 103 : SetUpVariantString (vaResult, alias_item->wildcards [3 ].c_str ()); break ;
@@ -2395,6 +2400,11 @@ CTrigger * trigger_item;
2395
2400
}
2396
2401
break ;
2397
2402
2403
+ case 38 :
2404
+ if (trigger_item->regexp )
2405
+ SetUpVariantLong (vaResult, trigger_item->regexp ->m_iMatchAttempts );
2406
+ break ;
2407
+
2398
2408
#ifdef PANE
2399
2409
case 38 : SetUpVariantString (vaResult, trigger_item->strPane ); break ;
2400
2410
#endif // PANE
You can’t perform that action at this time.
0 commit comments