路由器上的命令输出过滤中正则表达式的用法

路由器中常用的过滤命令有 begin exclude include

其后跟着的正则表达式,我只想说其中的一个符号的用法,就是下划线的作用,引用下思科的原文:

原文地址:

http://www.cisco.com/c/en/us/td/docs/ios-xml/ios/fundamentals/configuration/15_sy/fundamentals-15-sy-book/cf-cli-search.html


_ (underscore)

Matches a comma (,), left brace ({), right brace (}), left parenthesis ( ( ), right parenthesis ( ) ), the beginning of the string, the end of the string, or a space.

我们可能会遇到下列问题:

C2#show ip inte brief p | include xgei-0/2/0/1                                                      
xgei-0/2/0/1                    15.1.1.1        255.255.255.0   up    up   up
xgei-0/2/0/10                   unassigned      unassigned      up    up   up

本来是想只看到xgei-0/2/0/1 这一个接口的,可是现在却也能看到xgei-0/2/0/10  ,为了解决这个问题,可以使用下划线。


C2#show ip inte brief p | include xgei-0/2/0/1_
xgei-0/2/0/1                    15.1.1.1        255.255.255.0   up    up   up


可以完美解决这个问题。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值