Skip to Content
sed & awk, 2nd Edition
book

sed & awk, 2nd Edition

by Dale Dougherty, Arnold Robbins
March 1997
Intermediate to advanced
432 pages
11h 31m
English
O'Reilly Media, Inc.
Content preview from sed & awk, 2nd Edition

I Never Metacharacter I Didn’t Like

Table 3.4 lists interesting examples of regular expressions, many of which have been described in this chapter.

Table 3.4. Useful Regular Expressions
ItemRegular Expression
Postal Abbreviation for State□[A-Z][A-Z]□
City, State^.*,□[A-Z][A-Z]
City, State, Zip (POSIX egrep)^.*,□[A-Z][A-Z]□[0-9]{5}(-[0-9]{4})?
Month, Day, Year[A-Z][a-z]\{3,9\}□[0-9]\{1,2\},□[0-9]\{4\}
U.S. Social Security Number[0-9]\{3\}-[0-9]\{2\}-[0-9]\{4\}
North-American Local Telephone[0-9]\{3\}-[0-9]\{4\}
Formatted Dollar Amounts\$[□0-9]*\.[0-9][0-9]
troff In-line Font Requests\\f[(BIRP]C*[BW]*
troff Requests^\.[a-z]\{2\}
troff Macros^\.[A-Z12].
troff Macro with arguments^\.[A-Z12].□”.*”
HTML In-line Codes<[^>]*>
Ventura Publisher Style Codes^@.*□=□.*
Match blank lines^$
Match entire line^.*$
Match one or more spaces□□*
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

The AWK Programming Language, 2nd Edition

The AWK Programming Language, 2nd Edition

Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger

Publisher Resources

ISBN: 1565922255Supplemental ContentErrata Page