Back Reference Syntax

You can use back reference syntax in the new-value parameter for header and element rules configurations. Denoted by the use of $1, $2, $3, etc. (where the number refers to the regular expression’s stored value), you can reference the header and header rule’s stored value without having to use the header rule’s name. It instead refers to the stored value of this rule.

For example, when these settings are in place:

  • header-rule=changeHeader
  • action=manipulate
  • match-value=(.+)([^;])

you can set the new-value as sip:$2 instead of sip:$changeHeader.$2.

You can use the back reference syntax for:

  • Header rule actions manipulate and find-replace-all
  • Element rule actions replace and find-replace-all

Using back reference syntax simplifies your configuration steps because you do not need to create a store rule and then manipulate rule; the manipulate rule itself performs the store action if the comparison-type is set to pattern-rule.