Skip to content
Prev Previous commit
Next Next commit
Fix a bug
  • Loading branch information
Prashanth Govindarajan committed Jun 30, 2021
commit 19494455423e94809b5073cba7c824082c3bbbed
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ private bool MatchString(string str)
if (runtextend - runtextpos < c)
{
// If MatchString was called after a greedy op such as a .*, we would have zipped runtextpos to the end without really examining any characters. Reset to maxBacktrackPos here as an optimization
if (_maxBacktrackPosition != -1 && runtextpos > _maxBacktrackPosition)
if (!_caseInsensitive && _maxBacktrackPosition != -1 && runtextpos > _maxBacktrackPosition)
{
// If lastIndexOf is -1, we backtrack to the max extent possible.
runtextpos = _maxBacktrackPosition;
Expand Down