Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PATCH - new map type compare

1 view
Skip to first unread message

jma...@ttec.com

unread,
Oct 23, 2005, 7:28:51 PM10/23/05
to
http://www.jmaimon.com/sendmail/patches/compare-map.v1.81304.patch
http://www.jmaimon.com/sendmail

This patch introduces a new map type, compare. This map type can be
used to compare strings. Basic usage is like this:
Kcompare compare
And in a ruleset:
R$* $| $* $: $(compare $1 $@ $2 $: $)
RMATCH $#OK
R$* $#error

The map understands these arguments:
-a : string to return on successfull match (default MATCH)
-f : case sensitive search
-n : successfull return is if strings do NOT match
-T : string to return on unsuccessfull match (default blank)
If the map is called with only one string the following arguments are
relevant in this order
-z : delimiting charachter to seperate the key value into 2 strings
-k : string to use to seperate the key value into 2 strings
-v : string to use to seperate the key value into 2 strings

Currently, one can do something similar by storing the string into a
macro with a macro map and then by trying to match the LHS with it.
However that is a bit awkward and apparantly, more susceptible to
mangling.

0 new messages