A-153
Cisco ASR 9000 Series Aggregation Services Router Getting Started Guide
OL-28417-02
Understanding Regular Expressions, Special
Characters, and Patterns
This appendix describes the regular expressions, special or wildcard characters, and patterns that can be
used with filters to search through command output. The filter commands are described in the Filtering
show Command Output.
Contents
• Regular Expressions, page 153
• Special Characters, page 154
• Character Pattern Ranges, page 154
• Multiple-Character Patterns, page 155
• Complex Regular Expressions Using Multipliers, page 155
• Pattern Alternation, page 156
• Anchor Characters, page 156
• Underscore Wildcard, page 156
• Parentheses Used for Pattern Recall, page 157
Regular Expressions
A regular expression is a pattern (a phrase, number, or more complex pattern).
• Regular expressions are case sensitive and allow for complex matching requirements. Simple
regular expressions include entries like Serial, misses, or 138.
• Complex regular expressions include entries like 00210... , ( is ), or [Oo]utput.
A regular expression can be a single-character pattern or multiple-character pattern. It can be a single
character that matches the same single character in the command output or multiple characters that
match the same multiple characters in the command output. The pattern in the command output is
referred to as a string.
The simplest regular expression is a single character that matches the same single character in the
command output. Letters (A to Z and a to z), digits (0 to 9), and other keyboard characters
(such as ! or ~) can be used as a single-character pattern.