13 Regular Expressions

If there were just two things you should understand about regular expressions, they would be that regular expressions are supremely useful in advanced programming and that they’re easy to use but taxing to write. However, once you understand the rules for writing regular expressions, that extra knowledge will pay off in spades because regular expressions can vastly improve the quality of your programming.

This chapter will identify what regular expressions are, discuss the rules for constructing them (in great detail), and provide some useful examples demonstrating their capabilities.

Important Compatibility Note

Most of the book has been updated for PHP 6, while still being backward compatible for older versions. ...

Get PHP for the Web: Visual QuickStart Guide, Third 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.