printer: trim line terminator before finding submatches

This fixes a bug where PCRE2 look-around could change the result of a
match if it observed a line terminator in the printer. And in
particular, this is precisely how the searcher operates: the line is
considered unto itself *without* the line terminator.

Fixes #1401
This commit is contained in:
Andrew Gallant
2021-05-31 19:00:56 -04:00
parent efd9cfb2fc
commit ee23ab5173
4 changed files with 55 additions and 14 deletions

View File

@@ -71,6 +71,8 @@ Bug fixes:
Document cygwin path translation behavior in the FAQ.
* [BUG #1311](https://github.com/BurntSushi/ripgrep/issues/1311):
Fix multi-line bug where a search & replace for `\n` didn't work as expected.
* [BUG #1401](https://github.com/BurntSushi/ripgrep/issues/1401):
Fix buggy interaction between PCRE2 look-around and `-o/--only-matching`.
* [BUG #1412](https://github.com/BurntSushi/ripgrep/issues/1412):
Fix multi-line bug with searches using look-around past matching lines.
* [BUG #1642](https://github.com/BurntSushi/ripgrep/issues/1642):