TC4 Bug: Incorrect "Preview" with PCRE2 + capture group
Posted: Wed Mar 26, 2025 5:09 pm
Build 4.0.0.1 BETA
Steps to reproduce:
1) Create a text file, "test.txt", with the following content:
2) Under Settings > Regular Expression engine:
3) Under Find & Replace > Regular Expression:
4) Ensure that the Preview window is visible and "Preview replacements" is unchecked (disabled) and that the option, "Generate preview for all matches" is checked (enabled). Click "Replace".
Expected output in the Preview window after clicking "Replace":
Actual output in the Preview window after clicking "Replace":
If I open "test.txt", it does show that the file was properly processed (below), it's just that the Preview window is incorrect:
*I'm not sure what that leading "2" in the gutter is either.
Steps to reproduce:
1) Create a text file, "test.txt", with the following content:
Code: Select all
The quick brown fox jumped over the 123 lazy dogs.
Code: Select all
Engine: PCRE2
Code: Select all
Reg Ex: ([0-9]+)
Replace: \1\1
Expected output in the Preview window after clicking "Replace":
Code: Select all
X:\test.txt
2 123123 lazy dogs.
Code: Select all
X:\test.txt
2 123123123123 lazy dogs.
Code: Select all
The quick brown fox jumped over the 123123 lazy dogs.