regular expression which one is being used. Specify an IP address as
'.*\..*\..*\..*'
; specify a MAC
address as
'.*\..*\..*'
.
Resolving to a Uniform Type
Regular expressions must resolve to a uniform type. This is an example of an illegal regular expression:
group g-invalid
interface
‘
.*
’
bundle port-priority 10
!
interface
‘
.*Ethernet.*
’
bundle port-priority 10
!
end-group
In this example, the
bundle
command is supported for interface type GigabitEthernet but not for interface
type
‘
FastEthernet
’
. The regular expressions
‘
.*
’
and
‘
.*Ethernet.*
’
match both GigabitEthernet and FastEthernet
types. Because the
bundle
command is not applicable to both these interface types, they do not resolve to a
uniform type and therefore the system does not allow this configuration.
If the system cannot determine from the regular expression what the configuration should be, the expression
is not considered valid.
Note
The regular expression
‘
.*
’
is not allowed when referring to an interface identifier. You must begin the
regular expression for an interface identifier with an unambiguous word, followed by the regular expression.
Refer to
Regular Expressions for Interface Identifiers
in this section for more information.
Note
Overlapping Regular Expressions
Regular expressions are used in names of configuration statements within a configuration group. This permits
inheritance by the configuration when applied to matching names. Single quotes are used to delimit the regular
expression. Overlapping regular expression within a configuration group for the same configuration is permitted.
The example, given below, illustrates the process of creating and applying multiple configuration groups:
RP/0//CPU0:router(config)#group FB_flexi_snmp
RP/0//CPU0:router(config-GRP)# snmp-server vrf '.*'
RP/0//CPU0:router(config-GRP-snmp-vrf)# host 1.1.1.1 traps version 2c group_1
RP/0//CPU0:router(config-GRP-snmp-vrf)# host 1.1.1.1 informs version 2c group_1
RP/0//CPU0:router(config-GRP-snmp-vrf)# context group_1
RP/0//CPU0:router(config-GRP-snmp-vrf)#
RP/0//CPU0:router(config-GRP-snmp-vrf)#commit
RP/0//CPU0:router(config-GRP-snmp-vrf)#root
RP/0//CPU0:router(config)#
RP/0//CPU0:router(config)#snmp-server vrf vrf1
RP/0//CPU0:router(config-snmp-vrf)#snmp-server vrf vrf10
RP/0//CPU0:router(config-snmp-vrf)#!
RP/0//CPU0:router(config-snmp-vrf)#snmp-server vrf vrf100
RP/0//CPU0:router(config-snmp-vrf)#
RP/0//CPU0:router(config-snmp-vrf)#commit
RP/0//CPU0:router(config-snmp-vrf)#root
System Management Configuration Guide for Cisco NCS 5000 Series Routers, IOS XR Release 6.2.x
85
Configuring Flexible Command Line Interface
Regular Expressions in Configuration Groups