Basic regular expression primer

Regular expressions are the heart of the pattern-matching based text-processing techniques. For fluency in writing text-processing tools, one must have basic understanding of regular expressions. Regular expressions are a form of tiny, highly-specialized programming language used to match text. Using wild card techniques, the scope of matching text with patterns is very limited. This recipe is a walk through of basic regular expressions.

Getting ready

Regular expressions are the language used in most text processing utilities. Hence you will use the techniques learned in this recipe in many other recipes. [a-z0-9_]+@[a-z0-9]+\.[a-z]+ is an example of regular expression for matching an e-mail address.

Does this seem ...

Get Linux Shell Scripting Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.