Test -match utility

Test a mapping wildcard pattern.

Syntax
imsimta test -match

Parameters
None.

Description
may be used to test a mapping pattern, particularly, to test wildcard and glob matching.

When invoked,  prompts for a pattern  and then for a target string to compare against the pattern, and will  output whether or not the target string matched and if it did match,  which characters in the target string matched which wildcard or glob of  the pattern. will loop, prompting for input, until exitted with a CTRL/D (UNIX).

Examples
% imsimta test -match Pattern: $&#x5b;ax1&#x5d;&#x2a;@&#x2a;.acme.com &#x5b; 1S&#x5d; cglob &#x5b;1ax&#x5d; &#x5b; 2&#x5d; "@" &#x5b; 3S&#x5d; glob, req 109, reps 2 &#x5b; 4&#x5d; "." &#x5b; 5&#x5d; "a" &#x5b; 6&#x5d; "c" &#x5b; 7&#x5d; "m" &#x5b; 8&#x5d; "e" &#x5b; 9&#x5d; "." &#x5b; 10&#x5d; "c" &#x5b; 11&#x5d; "o" &#x5b; 12&#x5d; "m" Target: xx11a@sys1.acme.com Match. 0 - xx11a 1 - sys1 Pattern: $&#x5b;ax1&#x5d;&#x2a;@&#x2a;.acme.com &#x5b; 1S&#x5d; cglob &#x5b;1ax&#x5d; &#x5b; 2&#x5d; "@" &#x5b; 3S&#x5d; glob, req 109, reps 2 &#x5b; 4&#x5d; "." &#x5b; 5&#x5d; "a" &#x5b; 6&#x5d; "c" &#x5b; 7&#x5d; "m" &#x5b; 8&#x5d; "e" &#x5b; 9&#x5d; "." &#x5b; 10&#x5d; "c" &#x5b; 11&#x5d; "o" &#x5b; 12&#x5d; "m" Target: 12a@node.acme.com No match. Pattern: $&#x5b;ax1&#x5d;&#x2a;@&#x2a;.acme.com &#x5b; 1S&#x5d; cglob &#x5b;1ax&#x5d; &#x5b; 2&#x5d; "@" &#x5b; 3S&#x5d; glob, req 109, reps 2 &#x5b; 4&#x5d; "." &#x5b; 5&#x5d; "a" &#x5b; 6&#x5d; "c" &#x5b; 7&#x5d; "m" &#x5b; 8&#x5d; "e" &#x5b; 9&#x5d; "." &#x5b; 10&#x5d; "c" &#x5b; 11&#x5d; "o" &#x5b; 12&#x5d; "m" Target: 1xa@node.acme.com Match. 0 - 1xa 1 - node Pattern: ^D % In the above UNIX example, the sample mapping pattern   is tested for several sample target  strings. % imsimta test -match Pattern: $(1.2.3.0/24) &#x5b; 1S&#x5d; ipv4 &#x5b;1.2.3.0/255.255.255.0&#x5d; Target: 1.2.3.4 Match. 0 - 1.2.3.4 Pattern: $(1.2.3.0/24) &#x5b; 1S&#x5d; ipv4 &#x5b;1.2.3.0/255.255.255.0&#x5d; Target: 1.2.8.0 No match. Pattern: ^D % In the above UNIX example, the sample mapping pattern   is tested for two sample target strings.

See also:
 * Mapping entry patterns
 * MTA command line utilities