Hangs when doing a regex search & replace for $
For example, the following will cause Notepad2 to hang:
Mode: Regular Expression Search Search String: $ Replace With: test
Notepad2 (64-bit) 4.20.02 r2652 (fd22bee) on Windows 7
This is caused by changes in Scintilla 4.0.5, from the changelog: https://www.scintilla.org/ScintillaHistory.html
Bugs fixed in regular expression searches in Scintilla where some matches did not occur in an effort to avoid infinite loops when replacing on empty matches like "^" and "$". Applications should always handle empty matches in a way that avoids infinite loops, commonly by incrementing the search position after replacing an empty match. SciTE fixes a bug where replacing "^" always matched on the first line even when it was an "in selection" replace and the selection started after the line start.
A fix for the empty matches is done, I will push it after some testing.
Fixed in e8649d672bf16cc2f21a82c1fbb2e94807da8511, fell free to test whether there are other regex that will cause infinite loops. a similar bug is added on Scintilla at https://sourceforge.net/p/scintilla/bugs/2157/
Full fixed by 1bfaf31d6e05b99a1dd441854cfb82c3cf6f601e.