Scrub credit-card numbers from a block of text. A credit-card number is any sequence of 13–19 digits, optionally separated by spaces or hyphens in groups.
Replace each match with the string [REDACTED] and return the cleaned text as result.
Ready to take your skills to the next level? Enroll in our comprehensive Data Analyst Career Track to master SQL, Python, Excel, and Power BI.
Run your code to see the result here.