Resources

Regular Expression Elements

Table 4.1 presents a short list of the regular expression elements discussed in this chapter. For a full list of the extensive set of Perl regular expression operators, see the online documentation perldoc perlre.

Table 4.1. Regular Expression Elements Discussed in the Chapter
Element Meaning
<character > Match the given character. Works on letters, digits, and a few symbols. (Most symbols have a special meaning.)
^ Match the beginning of the line.
$ Match the end of the line.
* Repeat zero or more times.
+ Repeat one or more times
[xyz ] Match any of the characters “x”, “y”, or “z”. (Only one character in the string is matched.)
[a m ] Match any character from “a” to “m”.
[^xyz ] Match any character except ...

Get Perl for C Programmers 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.