3.7.g Implement and troubleshoot AS path manipulations

3.7.g [iii] Regexp

grep has been around as long as unix which puts that back to the 70’s… grep means global regular expression parser, or in some references, global regular expression and print, and still others, globally replace and print…  basically, anytime you filter IOS output, you are using grep…

from my linux box:

arteq@arteq-p7-1254:~$ ls -al | grep gns
drwxrwxr-x 33 arteq arteq  4096 Mar 27 07:37 gns3save

and from a router…

r3#sh run | i router
router eigrp 101

using regular expressions for bgp in IOS is the same principal, it’s not magic, it’s unix conventions from way back…

on your nix box do “man grep”

GREP(1)                                                                GREP(1)

grep, egrep, fgrep, rgrep – print lines matching a pattern

grep [OPTIONS] [-e PATTERN | -f FILE] [FILE…]

grep  searches the named input FILEs (or standard input if no files are
named, or if a single hyphen-minus (-) is given as file name) for lines
containing  a  match to the given PATTERN.  By default, grep prints the
matching lines.

from cisco: http://www.cisco.com/en/US/docs/ios/12_2/termserv/configuration/guide/tcfaapre_ps1835_TSD_Products_Configuration_Guide_Chapter.html

General Concepts About Regular Expressions

A regular expression is entered as part of a command and is a pattern made up of symbols, letters, and numbers that represent an input string for matching (or sometimes not matching). Matching the string to the specified pattern is called pattern matching.