Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

replace-pattern

Usage

Description

Replace a variable or identifier in the candidate configuration or open configuration database. Junos OS replaces the pattern specified by the replace-pattern attribute with the replacement pattern defined by the with attribute. The optional upto attribute limits the number of objects replaced. The placement of the attributes in the configuration data determines the scope of the replacement.

Attributes

replace-pattern="pattern1"

Text string or regular expression that defines the identifiers or values you want to match.

with="pattern2"

Text string or regular expression that replaces the identifiers and values located with pattern1.

upto="n"

Number of objects replaced. The value of n controls the total number of objects that the device replaces in the configuration (not the total number of times the pattern occurs). The device replaces objects at the same hierarchy level (siblings) first. The device considers multiple occurrences of a pattern within a given object as a single replacement. If you omit the upto attribute or if you set the attribute equal to zero, the device replaces all identifiers and values that match the pattern.

  • Range: 1 through 4294967295

  • Default: 0

Release Information

Attribute introduced in Junos OS Release 15.1R1.