Skip to content

ReplacementToken element

Markus Hastreiter edited this page Feb 18, 2020 · 1 revision

<ReplacementToken> element

The <ReplacementToken> element is used to configure custom replacement tokens.

Attributes

Attribute name Status Default Description
TokenName mandatory The name of the custom token. With this name you can reference the new custom token in other tags using #TokenName#.
Value mandatory The content of the new custom token. This can be a constant string, but you can also reference other replacement tokens here.
RegExPattern optional If a regex is specified it will be applied on the Value. The result is the actual content of this custom replacement token.
Replacement optional When "Replacement" is set, will execute RegEx.Replace instead of RegEx.Match, which means it can be used to build new tokens by replacing parts of the value of existing tokens.

Example

<ReplacementToken TokenName="Foo" Value="a constant text" />
<ReplacementToken TokenName="Bar" Value="#author# (#revision#)" />
<ReplacementToken TokenName="BugID" Value="#logmessage#" RegExPattern="Bug #(/d*)" />
<ReplacementToken TokenName="affectedpathswithseparator" Value="#affectedpaths#" RegExPattern="/n" Replacement=":" />