IP Routed Protocols

Pipe Returns Incorrect Matches on All Devices

Document ID: 116131

Updated: Jun 14, 2013

Contributed by Shashank Singh, Cisco TAC Engineer.



This document describes the problem encountered when a pipe symbol (|) is used in order to filter outputs and also describes the correct syntax of regular expressions used along with show commands to avoid unexpected results.



There are no specific requirements for this document.

Components Used

The information in this document is based on the correct use of the pipe symbol in order to filter outputs based on strings.

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, make sure that you understand the potential impact of any command.


The use of the pipe symbol in the command below returns incorrect output.

Switch#show run | include 
 ip address
 ip address


Use a dot (.) in order to match any single character, including a space and number. In the example above, matches: and
If you require a match with a special character, you must suppress its meaning with a backslash (\).  For example:

Switch# show run | include 1.1.1\.2 does not match IPs above

This behavior follows from the definition of Regular Expressions.

Related Information

Updated: Jun 14, 2013
Document ID: 116131