I believe I’ve found a problem when doing Find and Replace with Regular Expressions enabled, if the Find regular expression contains a look-behind assertion.
I can reproduce this problem very simply:
Place the cursor at the beginning of a file that contains just the following two lines of text (Mine is UTF-8 but that may not matter):
11
11
Press Control-R to enter Find and Replace mode. Click on Options, check the boxes beside Search with Regular Expressions (R) and Allow Wrapping.
Set the Find text to the regular expression (?<=1)1
.
Set the Replace text to 2
.
Press F4
or click Replace Next. The cursor moves, and the 1
at the end of the first line becomes selected, but nothing else changes. The file is not even marked as modified.
However, going back to the start of the first line and clicking Replace All produces the expected effect, resulting in a modified file reading:
12
12