TC-199
Cisco IOS Terminal Services Configuration Guide
78-12093-02
Regular Expressions
This appendix explains regular expressions and how to use them in Cisco IOS software commands. It
also provides details for composing regular expressions. This appendix has the following sections:
• General Concepts About Regular Expressions
• Cisco Regular Expression Pattern Matching Characters
• Single-Character Patterns
• Multiple-Character Patterns
• Multipliers
• Alternation
• Anchoring
• Parentheses for Recall
• Regular Expression Examples
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.
Pattern matching either succeeds or fails. If a regular expression can match two different parts of an input
string, it will match the earliest part first.
Cisco configurations uses regular expression pattern matching in several implementations. The
following is a list of some of these implementations:
• BGP IP AS-path and X.29 access lists
• Modem (or chat) and system scripts
• X.25 route substitute destination feature
• Protocol translation ruleset scripts