Appendix A. Regular Expressions

Regular expressions are used to match strings to patterns, rather than only to literal character strings. The regular expression (sometimes referred to as regex) is a pattern you want to match, such as a pattern that matches all names that begin with B or all phone numbers. Regular expressions are used by many Linux commands and applications that find/select specific text for processing. You can use regular expressions with grep, vi, sed, awk, Perl, PHP, OpenOffice, and many other applications.

Regular expressions are combinations of the following:

  • Literal characters: Normal characters that have no special meaning. A B is just a B, the second letter of the alphabet. It has no other meaning.

  • Special characters: ...

Get Spring Into Linux® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.