rtyley / bfg-repo-cleaner

Removes large or troublesome blobs like git-filter-branch does, but faster. And written in Scala
https://rtyley.github.io/bfg-repo-cleaner/
GNU General Public License v3.0
10.83k stars 535 forks source link

Improve Text-Replace Documentation/Examples #467

Open educweb opened 1 year ago

educweb commented 1 year ago

Hi,

I'm new to the tool but saw in the command line help:

  -rt, --replace-text <expressions-file>
                           filter content of files, replacing matched text. Match expressions should be listed in the file, one expression per line - by default, each expression is treated as a literal, but 'regex:' & 'glob:' prefixes are supported, with '==>' to specify a replacement string other than the default of '***REMOVED***'.

I stumbled quit a bit over the ==> (original I had a white space on either side of the arrow). It's not even mentioned on the docs website as a possibility. Could we update the documentation website to add a find and replace example? It probably wouldn't hurt to add a glob and regexp examples too, since I noticed those are also absent.

e.g. password.txt

private@private.com==>foobar@gmail.com
regex:password=\w+==>password=
glob:???
Sagor2214 commented 1 year ago

Hi,

I'm new to the tool but saw in the command line help:

  -rt, --replace-text <expressions-file>
                           filter content of files, replacing matched text. Match expressions should be listed in the file, one expression per line - by default, each expression is treated as a literal, but 'regex:' & 'glob:' prefixes are supported, with '==>' to specify a replacement string other than the default of '***REMOVED***'.

I stumbled quit a bit over the ==> (original I had a white space on either side of the arrow). It's not even mentioned on the docs website as a possibility. Could we update the documentation website to add a find and replace example? It probably wouldn't hurt to add a glob and regexp examples too, since I noticed those are also absent.

e.g. password.txt

private@private.com==>foobar@gmail.com
regex:password=\w+==>password=
glob:???