Single Field Substitutions ($&, $!, $*, $#)

Single field substitutions extract a single subdomain part from the host/domain specification being rewritten. The available single field substitutions are shown in TABLE 3-4.

TABLE  3-4   Single Field Substitutions
Control Sequence
Usage

$&n  

Substitute the nth element, n=0,1,2,..,9, in the host specification (the part that did not match or matched a wildcard of some kind). Elements are separated by dots; the first element on the left is element zero. The rewrite fails if the requested element does not exist.  

$!n  

Substitute the nth element, n=0,1,2,..,9, in the host specification (the part that did not match or matched a wildcard of some kind). Elements are separated by dots; the first element on the right is element zero. The rewrite fails if the requested element does not exist.  

$*n  

Substitute the nth element, n=0,1,2,...,9, in the domain specification (the part that did match explicit text in the pattern). Elements are separated by dots; the first element on the left is element zero. The rewrite fails if the requested element does not exist.  

$#n  

Substitute the nth element, n=0,1,2,...,9, in the domain specification (the part that did match explicit text in the pattern). Elements are separated by dots; the first element on the right is element zero. The rewrite fails if the requested element does not exist.  

Suppose the address jdoe@vaxa.acme.com matches the following rewrite rule:

 
*.ACME.COM     $U%$&0.acme.com@mailhub.acme.com 
 

Then the result from the template will be jdoe@vaxa.acme.com with mailhub.acme.com used as the routing system.




Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.