Appendix A. Regular Expressions

Regular expressions describe patterns that you can use to search code and text. Searching with regular expressions is covered in Lesson 17. The following table lists the special characters that are used in regular expressions, descriptions of their meanings, and examples of their matches.

TypeDescriptionExample
^Beginning of input or line^T matches “T” in “This good earth,” but not in “Uncle Tom”
$End of input or lineh$ matches “h” in “teach,” but not in “teacher”
*The preceding character zero or more timesum* matches “um” in “rum,” “umm” in “yummy,” and “u” in “huge”
+The preceding character one or more timesum+ matches “um” in “rum” and “umm” in “yummy,” but nothing in “huge”
?The preceding character zero or one time ...

Get macromedia Dreamweaver 8 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.