protected override bool FindFirstChar()
{
int i;
String set;
if (0 != (runanchors & (RegexFCD.Beginning | RegexFCD.Start | RegexFCD.EndZ | RegexFCD.End)))
{
if (!runcode._rightToLeft)
{
if ((0 != (runanchors & RegexFCD.Beginning) && runtextpos > runtextbeg) ||
(0 != (runanchors & RegexFCD.Start) && runtextpos > runtextstart))
{
runtextpos = runtextend;
return(false);
}
if (0 != (runanchors & RegexFCD.EndZ) && runtextpos < runtextend - 1)
{
runtextpos = runtextend - 1;
}
else if (0 != (runanchors & RegexFCD.End) && runtextpos < runtextend)
{
runtextpos = runtextend;
}
}
else
{
if ((0 != (runanchors & RegexFCD.End) && runtextpos < runtextend) ||
(0 != (runanchors & RegexFCD.EndZ) && (runtextpos < runtextend - 1 ||
(runtextpos == runtextend - 1 && CharAt(runtextpos) != '\n'))) ||
(0 != (runanchors & RegexFCD.Start) && runtextpos < runtextstart))
{
runtextpos = runtextbeg;
return(false);
}
if (0 != (runanchors & RegexFCD.Beginning) && runtextpos > runtextbeg)
{
runtextpos = runtextbeg;
}
}
if (runbmPrefix != null)
{
return(runbmPrefix.IsMatch(runtext, runtextpos, runtextbeg, runtextend));
}
}
else if (runbmPrefix != null)
{
runtextpos = runbmPrefix.Scan(runtext, runtextpos, runtextbeg, runtextend);
if (runtextpos == -1)
{
runtextpos = (runcode._rightToLeft ? runtextbeg : runtextend);
return(false);
}
return(true);
}
if (runfcPrefix == null)
{
return(true);
}
runrtl = runcode._rightToLeft;
runci = runfcPrefix.CaseInsensitive;
set = runfcPrefix.Prefix;
if (RegexCharClass.IsSingleton(set))
{
char ch = RegexCharClass.SingletonChar(set);
for (i = Forwardchars(); i > 0; i--)
{
if (ch == Forwardcharnext())
{
Backwardnext();
return(true);
}
}
}
else
{
for (i = Forwardchars(); i > 0; i--)
{
if (RegexCharClass.CharInSet(Forwardcharnext(), set, String.Empty))
{
Backwardnext();
return(true);
}
}
}
return(false);
}