Example 3: Removing a selection of characters from an email address

Match string: (.*)[#!_\.\s]*(.*)

Replacement string: $1$2

Input data: fred.bloggs@acme.com, #jim_bloggs@acme.com

Output data: fredbloggs@acme.com, jim_bloggs@acme.com

The string [#!_\.\s]* matches against the pound (#), exclamation mark, underscore, period, and whitespace characters, with the final asterisk allowing multiple matches. The string (.*) on either side places all other characters in parameters 1 and 2. These parameters then form the replacement string, stripping out all instances of the matched characters.