26.10 Pattern Matching Quick Reference with ExamplesArticle 26.4 gives a tutorial introduction to regular expressions. This article is intended for those of you who just need a quick listing of regular expression syntax as a refresher from time to time. It also includes some simple examples. The characters in Table 26.6 have special meaning only in search patterns.
The characters in Table 26.7 have special meaning only in replacement patterns.
26.10.1 Examples of SearchingWhen used with grep
or egrep
, regular expressions
are surrounded by quotes. (If the pattern contains a
26.10.2 Examples of Searching and ReplacingThe following examples show the metacharacters
available to sed
or ex
.
(ex
commands begin with a colon.)
A space is marked by ; a TAB is marked by
- from O'Reilly & Associates' UNIX in a Nutshell (SVR4/Solaris) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|