The string @.* matches against anything following an @ symbol, which indicates that a domain is present. The ^ symbol ensures that matching strings are excluded from replacement, and all data without a domain is removed.
The string \s* removes any whitespace at the start of the matching string, and
(\S*) matches against the remaining non-whitespace characters. The parentheses allow you to reference this matching string as parameter 1
($1).
In the replacement string, $1 contains the text matched by
\S*, and then
acme.com is appended to that text.
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.
The match string .*@acme\. detects any address that contains the string
@acme. and is preceded by 1 or more characters. The final full stop needs to be escaped (preceded by a backslash), to avoid being interpreted as any character.
The parentheses around this part of the match string ensure the string is placed in parameter 1. The final org in the match is outside the parentheses, hence it does not get placed in parameter 1. The replacement string contains the text
com which is appended to the string matched by:
These filters match and exclude any email address that ends in @somewhere.com or
@here.com. The remaining email addresses are uploaded.