Google Grupper støtter ikke lenger nye Usenet-innlegg eller -abonnementer. Historisk innhold er fortsatt synlig.

PATCH - new map type compare

Sett 1 gang
Hopp til første uleste melding

jma...@ttec.com

ulest,
23. okt. 2005, 19:28:5123.10.2005
til
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 nye meldinger