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 scope of the replacement is determined by the placement of the attributes in the configuration data.

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 are replaced in the configuration (not the total number of times the pattern occurs). Objects at the same hierarchy level (siblings) are replaced first. Multiple occurrences of a pattern within a given object are considered a single replacement. If you do not include the upto attribute or you set the attribute equal to zero, all identifiers and values in the configuration that match the pattern are replaced.

  • Range: 1 through 4294967295

  • Default: 0

Release Information

Attribute introduced in Junos OS Release 15.1R1.