The <subst> element has the following attributes:
match – A required attribute that is a case-sensitive Perl-like regular expression that is sought after in the input. This attribute can reference simple substitution variables.
replace – A required attribute that is a Perl-like replacement value that is substituted for each occurrence of the pattern given by match. This value is not interpreted verbatim: the $n construct is interpreted as the nth parenthetical expression inside the matching expression. This attribute can reference simple substitution variables.
The following transformation converts all occurrences of the string 127.0.0.xxx to 10.10.0.xxx in the /etc/hosts file:
<transform output=”/etc/hosts”> <subst match="127\.0\.0\.(\d+)" replace="10.10.0.$1"/> </transform> |