|
|
|
|
@ -40,7 +40,10 @@ namespace SearchAndReplace
@@ -40,7 +40,10 @@ namespace SearchAndReplace
|
|
|
|
|
while (textIterator.MoveAhead(1)) { |
|
|
|
|
Match m = regex.Match(document, textIterator.Position); |
|
|
|
|
if (m == null || !m.Success) { |
|
|
|
|
break; |
|
|
|
|
while (textIterator.Position < document.Length - 1) { |
|
|
|
|
if (!textIterator.MoveAhead(1)) |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
int delta = m.Index - textIterator.Position; |
|
|
|
|
if (delta <= 0 || textIterator.MoveAhead(delta)) { |
|
|
|
|
@ -61,7 +64,10 @@ namespace SearchAndReplace
@@ -61,7 +64,10 @@ namespace SearchAndReplace
|
|
|
|
|
while (textIterator.MoveAhead(1) && TextSelection.IsInsideRange(textIterator.Position, offset, length)) { |
|
|
|
|
Match m = regex.Match(document, textIterator.Position); |
|
|
|
|
if (m == null || !m.Success) { |
|
|
|
|
break; |
|
|
|
|
while (textIterator.Position < document.Length - 1) { |
|
|
|
|
if (!textIterator.MoveAhead(1)) |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
int delta = m.Index - textIterator.Position; |
|
|
|
|
if (delta <= 0 || textIterator.MoveAhead(delta)) { |
|
|
|
|
|