A Practical Guide to Red HatВ® LinuxВ®: Fedoraв„ў Core and Red Hat Enterprise Linux (3rd Edition)

A. Regular Expressions

IN THIS APPENDIX

Characters

968

Delimiters

968

Simple Strings

968

Special Characters

968

Rules

971

Bracketing Expressions

972

The Replacement String

972

Extended Regular Expressions

973

A regular expression defines a set of one or more strings of characters. A simple string of characters is a regular expression that defines one string of characters: itself. A more complex regular expression uses letters, numbers, and special characters to define many different strings of characters. A regular expression is said to match any string it defines.

This appendix describes the regular expressions used by ed, vim, emacs, grep, gawk, sed, and other utilities. The regular expressions used in shell ambiguous file references are different and are described in "Filename Generation/Pathname Expansion" on page 221.

Категории