Appendix D. Summary of Regular Expressions

A regular expression is a way of specifying a pattern that filters text and only matches particular strings. Once a string has been matched, it can be extracted from the larger body of text or replaced with another string. In Perl, another common technique is to use regular expressions as conditions in if statements so that the statement evaluates as True if a particular text string contains text that matches the expression.

Like arithmetic expressions, regular expressions are made up of a sequence of legal symbols linked with legal operators. Table D.1 lists all of these operators and symbols. If you’re interested in investigating regular expressions more deeply, read Jeffrey E. F. Friedl’s Mastering ...

Get Sams Teach Yourself CGI in 24 Hours, Second 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.