Chapter 8. Regular Expressions—Pattern Matching

Regular Expressions—Pattern Matching

What Is a Regular Expression?

If you are familiar with UNIX utilities, such as vi, sed, grep, and awk, you have met face-to-face with the infamous regular expressions and metacharacters used in delimiting search patterns. Well, with Perl, they’re back!

What is a regular expression, anyway? A regular expression is really just a sequence, or pattern, of characters that is matched against a string of text when performing searches and replacements. A simple regular expression consists of a character or set of characters that matches itself. The regular expression is normally delimited by forward slashes. ...

Get Perl by Example, Fourth Edition 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.