HomeReplacement Generators
Replacement Generators
Patterns for find and replace operations.
8 Tools Available
Mask Email
Replace with *.
/(?<=.{2}).(?=.*@)/
Swap First Last
Use $2, $1 to swap.
/^(\w+)\s(\w+)$/
Mask Credit Card
Replace with ************.
/\d{12}/
Format Phone
Replace $1-$2-$3.
/(\d{3})(\d{3})(\d{4})/
Remove HTML
Replace with empty string.
/<[^>]+>/
Trim Whitespace
Replace with empty string.
/^\s+|\s+$/
Double to Single
Replace with single space.
/\s{2,}/
Obfuscate Phone
Mask phone digits.
/\d(?=\d{4})/