Introduction
We use gsub with regex to find and replace patterns in text easily.
When you want to replace all phone numbers in a text with a placeholder.
When cleaning up user input by removing unwanted characters.
When formatting dates or codes in a string.
When censoring certain words in a message.
When changing all email addresses in a document to a generic text.