
Redact IP addresses in text
redact_ip_addresses.Rd
This function redacts IP addresses in a given text by replacing them with a specified string.
Arguments
- text
The text in which IP addresses are to be redacted.
- replace_with
A string to replace IP addresses with. It can be either a whole word pattern or a single character. Default is NULL, which uses the default value specified in the `replace_pattern()` function.
Examples
text <- "My IP address is 192.168.0.1. Please don't share it with anyone."
redacted_text <- redact_ip_addresses(text)
cat(redacted_text)
#> My IP address is [REDACTED]. Please don't share it with anyone.