我需要帮助才能使用正则表达式单独查找接口。
!
interface Loopback0
ip address 152.135.2.2 255.255.255.255
!
interface Port-channel1
description *** 2 port Etherchannel to ic***
switchport
switchport mode trunk
!
interface FastEthernet1
vrf forwarding mgmtVrf
no ip address
speed auto
duplex auto
!
interface TenGigabitEthernet3/1
!
interface Vlan1
no ip address
!
interface Vlan42
ip address 10.2.2.3 255.255.255.240
standby 42 ip 10.2.2.31
standby 42 priority 105
standby 42 preempt
!
interface GigabitEthernet6/48
description ***connected to Panel***
switchport access vlan 10
switchport mode access
spanning-tree portfast
!
interface GigabitEthernet7/1
!
我正在尝试使用以下语法,但是它显示了与
不匹配的所有接口信息"^((?!Ten|Vlan|Loopback|Port).)*$"
我正在寻找以下结果。
interface FastEthernet1
interface GigabitEthernet6/4
interface GigabitEthernet7/1
答案 0 :(得分:1)
如果您只需要3行:
interface FastEthernet1
interface GigabitEthernet6/4
interface GigabitEthernet7/1
然后你可以使用以下正则表达式:
^interface\s*(?=Fast|Giga).*