Last active
October 5, 2020 23:21
-
-
Save Wind010/0b205ac52c3fde9574400254ba5b6af4 to your computer and use it in GitHub Desktop.
BFG Replace Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SomePassword # Replace literal string 'SomePassword' with '***REMOVED***' (default) | |
| SomePassword==>examplePass # Replace with 'examplePass' instead | |
| SomePassword==> # Replace with the empty string | |
| regex:password=\w+==>password= # Replace, using a regex | |
| regex:\r(\n)==>$1 # Replace Windows newlines with Unix newlines | |
| regex:(?i)(passsWord)==> # Replace "password" insensitively | |
| regex:\"Number\":\s+\"\d+\"==>"Number: "***REMOVED***" # Remove number after "Number": | |
| # Ensure that multi-line flag is used (java -jar bfg.jar --multi-line-regex --replace-text bfg_replace.txt) | |
| regex:(?s)-----BEGIN RSA PRIVATE KEY-----(.+)-----END RSA PRIVATE KEY-----==>REMOVED |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment