26.8 I Never Meta Character I Didn't Like
Once you know regular expression syntax, you can match almost
anything.
But sometimes, it's a pain to think through how to get
what you want.
Here are some useful regular expressions that
match various kinds of data you might have to deal with in the UNIX
environment.
Some of these examples work in any program that uses regular expressions;
others only work with a specific program such as
egrep
.
(Article
26.9
lists the metacharacters that each program accepts.)
The Note that these regular expressions are only examples. They aren't meant to match (for instance) every occurrence of a city and state in any arbitrary text. But if you can picture what the expression does and why, that should help you write an expression that fits your text.
- , |
|