Skip to content

Regex, replace entire line on a hit. #532

@joshuagarrison

Description

@joshuagarrison

I am looking to have BFG clean my repos. However I when a string is found instead of replace the string I want to replace the entire line of the file.

Take this example. I have several files over several repos with API keys in them.

<block> <APIKEY>HASH1</APIKEY> </block>

As I understand I would have to gather all "Hash1" "Hash2" "Hash3" etc in a large file and tell bfg to replace them. I simply want to replace the entire line with REDACTED LINE or some other string. when the string "<APIKEY>" is found.

The above is a made up example that can be applied to all the cases I have. I can bring out specific cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions