Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Scan() [2/2]

Match? System.Text.RegularExpressions.RegexRunner.Scan ( Regex regex,
string text,
int textbeg,
int textend,
int textstart,
int prevlen,
bool quick,
TimeSpan timeout )
inlinepackage

Definition at line 52 of file RegexRunner.cs.

53 {
54 _timeout = -1;
55 bool flag = (_ignoreTimeout = Regex.InfiniteMatchTimeout == timeout);
56 if (!flag)
57 {
58 Regex.ValidateMatchTimeout(timeout);
59 _timeout = (int)(timeout.TotalMilliseconds + 0.5);
60 _timeoutOccursAt = Environment.TickCount + _timeout;
62 }
63 int num = 1;
64 int num2 = textend;
65 if (regex.RightToLeft)
66 {
67 num = -1;
68 num2 = textbeg;
69 }
70 runtextpos = textstart;
71 if (prevlen == 0)
72 {
73 if (textstart == num2)
74 {
75 return Match.Empty;
76 }
77 runtextpos += num;
78 }
79 runregex = regex;
80 runtext = text;
81 runtextstart = textstart;
82 runtextbeg = textbeg;
83 runtextend = textend;
84 bool flag2 = false;
85 while (true)
86 {
87 if (FindFirstChar())
88 {
89 if (!flag)
90 {
92 }
93 if (!flag2)
94 {
96 flag2 = true;
97 }
98 Go();
99 Match match = runmatch;
100 if (match._matchcount[0] > 0)
101 {
102 runtext = null;
103 if (quick)
104 {
105 runmatch.Text = null;
106 return null;
107 }
108 runmatch = null;
110 return match;
111 }
112 runtrackpos = runtrack.Length;
113 runstackpos = runstack.Length;
114 runcrawlpos = runcrawl.Length;
115 }
116 if (runtextpos == num2)
117 {
118 break;
119 }
120 runtextpos += num;
121 }
122 runtext = null;
123 if (runmatch != null)
124 {
125 runmatch.Text = null;
126 }
127 return Match.Empty;
128 }

References System.Text.RegularExpressions.RegexRunner._ignoreTimeout, System.Text.RegularExpressions.RegexRunner._timeout, System.Text.RegularExpressions.RegexRunner._timeoutChecksToSkip, System.Text.RegularExpressions.RegexRunner._timeoutOccursAt, System.Text.RegularExpressions.RegexRunner.DoCheckTimeout(), System.Text.RegularExpressions.Match.Empty, System.Text.RegularExpressions.RegexRunner.FindFirstChar(), System.Text.RegularExpressions.RegexRunner.Go(), System.Text.RegularExpressions.RegexRunner.InitializeForGo(), System.match, System.Text.RegularExpressions.Regex.RightToLeft, System.Text.RegularExpressions.RegexRunner.runcrawl, System.Text.RegularExpressions.RegexRunner.runcrawlpos, System.Text.RegularExpressions.RegexRunner.runmatch, System.Text.RegularExpressions.RegexRunner.runregex, System.Text.RegularExpressions.RegexRunner.runstack, System.Text.RegularExpressions.RegexRunner.runstackpos, System.Text.RegularExpressions.RegexRunner.runtext, System.Text.RegularExpressions.RegexRunner.runtextbeg, System.Text.RegularExpressions.RegexRunner.runtextend, System.Text.RegularExpressions.RegexRunner.runtextpos, System.Text.RegularExpressions.RegexRunner.runtextstart, System.Text.RegularExpressions.RegexRunner.runtrack, System.Text.RegularExpressions.RegexRunner.runtrackpos, System.text, System.Text.RegularExpressions.Match.Tidy(), System.timeout, and System.Text.RegularExpressions.Regex.ValidateMatchTimeout().