Martin Ward wrote,
W> Actually, the expansion of ^TO_ cannot end in a letter or digit
W> or underscore or fullstop,
Nor a hyphen.
W> ... while the expansion of ^TO cannot end in a letter.
True. I thought that the set included digits and underscores and periods
as well (but not hyphens). Thanks for pointing that out.
W> So if the local part of an address @mediaone.net ends
W> in a digit (for example), ^TO(_at_)mediaone(_dot_)net will still match.
True. I had said,
T> It really ought to look more like this;
T> :0
T> * ! ^TO[a-z0-9_]+(_at_)mediaone\(_dot_)net
T> { INCLUDERC=ackmail.rc }
to which Martin responded,
W> This won't catch FOO(_at_)mediaone(_dot_)net, or various other characters
W> which are legal in the local part of an address.
Yes it will. Regexp matching is case-insensitive unless you specify the `D'
flag. However, depending on what mediaone allows in a local part, it would
cause a problem with a local part that ends in a hyphen or a period or a plus
sign.
W> I suggest either a simple ^TOmediaone\.net
W> (which will also catch name(_at_)host(_dot_)mediaone(_dot_)net),
W> or ^TO(_dot_)*(_at_)mediaone\(_dot_)net (if you only want to
name(_at_)mediaone(_dot_)net).
Those would do, with the caveat that people often eviscerate ^TO and ^TO_
by adding .* after them, so when one posts code here that has a proper
reason for putting .* after ^TO or ^TO_, one should point out that it is
the exception.