
Redact email addresses in text
redact_email_addresses.Rd
This function redacts email addresses in a given text by replacing them with a specified string.
Arguments
- text
The text in which email addresses are to be redacted.
- replace_with
A string to replace email 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 <- "Hello, my email address is john.doe@gmail.com. Please don't share it with anyone."
redacted_text <- redact_email_addresses(text)
cat(redacted_text)
#> Hello, my email address is [REDACTED]. Please don't share it with anyone.