regex: some minor polish

I think I already did a clean-up of this crate when I moved it to regex
1.9, so the polish here is very minor.
This commit is contained in:
Andrew Gallant
2023-09-25 17:21:28 -04:00
parent 798f8981eb
commit 82d3183a04
6 changed files with 16 additions and 127 deletions

View File

@@ -20,11 +20,11 @@ use crate::error::{Error, ErrorKind};
///
/// Note that as of regex 1.9, this routine could theoretically be implemented
/// without returning an error. Namely, for example, we could turn
/// `foo\nbar` into `foo[a&&b]bar`. That is, replace line terminators with a
/// `foo\nbar` into `foo[a&&b]bar`. That is, replace line terminator with a
/// sub-expression that can never match anything. Thus, ripgrep would accept
/// such regexes and just silently not match anything. Regex versions prior to 1.8
/// don't support such constructs. I ended up deciding to leave the existing
/// behavior of returning an error instead. For example:
/// such regexes and just silently not match anything. Regex versions prior
/// to 1.8 don't support such constructs. I ended up deciding to leave the
/// existing behavior of returning an error instead. For example:
///
/// ```text
/// $ echo -n 'foo\nbar\n' | rg 'foo\nbar'