The following regular expressions can be used to search documents for email addresses, or manage mailing lists.
Paste the following regular expression to the "Find what" box of the Find/Replace panel of the Control Board to match any well-formed email address in your document:
<[^$^#.+\-_]@\@[^$^#.\-]{1,}.^${2,}>
<[^$^#.+\-_]{0,}^#[^$^#.+\-_]{0,}\@[^$^#.\-]{1,}.^${2,}>
The above regular expression will match email addresses containing digits within the prefix (to the left of the "@" symbol).
For example:
joeandjane1977@gmail.com
532alonso@yahoo.com.br
pete15@live10.com
<[^$^#]@[.+\-_][^$^#.+\-_]@\@[^$^#.\-]{1,}.^${2,}>
The above regular expression will match email addresses containing periods, "plus" signs, hyphens, or underscores within the prefix (to the left of the "@" symbol).
For example:
wolfgang.limann@web.de
joseph+atlantis@mypublishing.com
billy.van_bonghe@skynet.be
The following regular expression will match email addresses with the "de" domain:
<[^$^#.+\-_]@\@[^$^#.\-]@.de>
For example:
wolfgang.limann@web.de
willi.kovermann@online.de
peter124512@gmx.de
The following regular expression will match email addresses with the "co.uk" domain:
<[^$^#.+\-_]@\@[^$^#.\-]@.co.uk>
For example:
jack.spinooza@yahoo.co.uk
ali1281-89@hotmail.co.uk
markmark@live.co.uk
The following regular expression will match email addresses with multiple periods within the domain part:
<[^$^#.+\-_]@\@([^$^#\-]@.){2,}^${2,}>
For example:
i.m.alive@bigpond.net.au
zola5401m@yahoo.com.ar
wjeremy@health.bti.go.pl
The following regular expression will match email addresses containing 'yahoo' as a sub-domain:
<[^$^#.+\-_]@\@yahoo.(^$@.){0,}^${2,}>
For example:
philippe.olenko@yahoo.fr
uamundo@yahoo.com.ar
psychother@yahoo.co.uk
If you use the following regular expression as a "find what" pattern:
<([^$^#.+\-_]@\@)yahoo.(^$@.){0,}^${2,}>
and the following one as a "replace with" pattern:
\1gmail.com
you could replace 'yahoo' domains within email addresses with "gmail.com'.
For example, the following email addresses:
philippe.olenko@yahoo.fr
uamundo@yahoo.com.ar
psychother@yahoo.co.uk
would be replaced with these ones:
philippe.olenko@gmail.com
uamundo@gmail.com
psychother@gmail.com
Note: Before searching with a regular expression, make sure that the "Use wildcards" option is enabled in the Find/Replace panel of the Control Board:
or in the Find/Replace dialog:
Tip:
See also...