O'Reilly logo

PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, Fourth Edition by Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

14. Perl-Compatible Regular Expressions

In This Chapter

Creating a Test Script 434

Defining Simple Patterns 438

Using Quantifiers 441

Using Character Classes 443

Finding All Matches 446

Using Modifiers 450

Matching and Replacing Patterns 452

Review and Pursue 456

Regular expressions are an amazingly powerful (but tedious) tool available in most of today’s programming languages and even in many applications. Think of regular expressions as an elaborate system of matching patterns. You first write the pattern and then use one of PHP’s built-in functions to apply the pattern to a value (regular expressions are applied to strings, even if that means a string with a numeric value). Whereas a string function could see if the name John is in some text, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required