private bool Refmatch(int index, int len)
{
int c;
int pos;
int cmpos;
if (!_rightToLeft)
{
if (runtextend - runtextpos < len)
return false;
pos = runtextpos + len;
}
else
{
if (runtextpos - runtextbeg < len)
return false;
pos = runtextpos;
}
cmpos = index + len;
c = len;
if (!_caseInsensitive)
{
while (c-- != 0)
if (runtext[--cmpos] != runtext[--pos])
return false;
}
else
{
while (c-- != 0)
if (_culture.TextInfo.ToLower(runtext[--cmpos]) != _culture.TextInfo.ToLower(runtext[--pos]))
return false;
}
if (!_rightToLeft)
{
pos += len;
}
runtextpos = pos;
return true;
}