Cisco Systems A9K24X10GETR Network Router User Manual


 
FINAL DRAFT —Cisco Confidential
A-1
Cisco ASR 9000 Series Aggregation Services Router Getting Started Guide
OL-17502-01
APPENDIX
A
Understanding Regular Expressions, Special
Characters, and Patterns
This appendix describes regular expressions, special or wildcard characters, and patterns used with
filters to search through command output. Filter commands are described in the
“Filtering show
Command Output” section on page 5-9.
Contents
Regular Expressions, page A-1
Special Characters, page A-2
Character Pattern Ranges, page A-2
Multiple-Character Patterns, page A-3
Complex Regular Expressions Using Multipliers, page A-3
Pattern Alternation, page A-4
Anchor Characters, page A-4
Underscore Wildcard, page A-4
Parentheses Used for Pattern Recall, page A-4
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 called
a string.
The simplest regular expression is a single character that matches the same single character in the
command output. Letter (A–Z and a–z), digits (0–9), and other keyboard characters (such as ! or ~) can
be used as a single-character pattern.