O'Reilly logo

Linux Shell Scripting Cookbook by Sarath Lakshman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required