Method TryCreateForAddressPattern
- Namespace
- MailFathom.Domain.Contacts.Collection
- Assembly
- MailFathom.Domain.dll
TryCreateForAddressPattern(string?, out ContactCollectionExclusion?)
Builds an entry that excludes every address one pattern selects.
public static bool TryCreateForAddressPattern(string? pattern, out ContactCollectionExclusion? exclusion)
Parameters
patternstringThe pattern text an operator supplied.
exclusionContactCollectionExclusionThe entry, when the text is a pattern this system can hold an address against.
Returns
Remarks
Blank text and text beyond MaximumPatternLength are refused, and so is a pattern that narrows nothing: an entry matching every address would switch collection off through a list written to narrow it, and an owner meaning that turns collection off where it is turned on.
A pattern narrows nothing when its only characters are the two wildcards and the at-sign, which is wider than
refusing an all-wildcard pattern and is the shape that actually reaches an owner. *@* is not all wildcards
— it carries a literal — and yet it matches every address there is, because a normalized address holds exactly
one at-sign and arbitrary text on either side of it. The same rule also refuses the mirror mistakes, *@
and @*, which match no address at all, and that is deliberate: an entry selecting on nothing an address
can differ by is a typo whichever way it lands, and this is the one place it can still be said out loud.