s i s t e m a o p e r a c i o n a l m a g n u x l i n u x | ~/ · documentação · suporte · sobre |
3.15. Regular ExpressionsIn order to fully utilize the power of shell scripting, you need to master regular expressions. 3.15.1. A Brief Introduction to Regular ExpressionsAn expression is a set of characters that has an interpretation above and beyond its literal meaning. A quote symbol ("), for example, may denote speech by a person, ditto, or a meta-meaning for the symbols that follow. Regular expressions are sets of characters that UNIX endows with special features. The main uses for regular expressions (REs) are text searches and string manipulation. An RE matches a single character or a set of characters.
"Sed & Awk", by Dougherty and Robbins (see Bibliography) gives a very complete and lucid treatment of REs. 3.15.2. Using REs in scriptsSed, awk, and Perl, used as filters in scripts, take REs as arguments when "sifting" or transforming files or I/O streams. See Example A-4 and Example A-8 for illustrations of this. |