From 9282a33a028bf35bcbb481b3a84beb1a68613a0a Mon Sep 17 00:00:00 2001 From: Elijah Newren Date: Mon, 19 Oct 2020 07:01:02 -0700 Subject: [PATCH] git-filter-repo.txt: regexes & globs apply to entire file, not to lines Signed-off-by: Elijah Newren --- Documentation/git-filter-repo.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Documentation/git-filter-repo.txt b/Documentation/git-filter-repo.txt index 6a9e150..6aa2a8a 100644 --- a/Documentation/git-filter-repo.txt +++ b/Documentation/git-filter-repo.txt @@ -872,9 +872,12 @@ YYYY-MM-DD. In the expressions file, there are a few things to note: globs (see https://docs.python.org/3/library/fnmatch.html), or regular expressions (see https://docs.python.org/3/library/re.html#regular-expression-syntax). If none of these are specified, `literal:` is assumed. - * globs and regexes are applied to each line of the file; it is not - possible with --replace-text to match a multi-line string. - * If multiple matches are found on a line, all are replaced. + * If multiple matches are found, all are replaced. + * globs and regexes are applied to the entire file, but without any + special flags turned on. Some folks may be interested in adding `(?m)` + to the regex to turn on MULTILINE mode, so that `^` and `$` match the + beginning and ends of lines rather than the beginning and end of file. + See https://docs.python.org/3/library/re.html for details. See also the `--blob-callback` from <>.