[ Team LiB ] Previous Section Next Section

Summary

Regular expressions are a huge subject, and we've really only scraped the surface of their power in this hour. Nevertheless, you should now be able to use regular expression functions to find and replace complex patterns in text.

You should be able to use the preg_match() regular expression function to find patterns in strings and the preg_replace() function to replace all instances of a pattern in a string. You should be able to find ranges of characters using character classes, multiple patterns using quantifiers, and alternative patterns using branches. You should be able to extract subpatterns and refer to them with backreferences. You should be able to use escape characters to anchor patterns or to match character types. You should be able to use modifiers to change the way in which PCREs work.

In the next hour, we will examine some core techniques for creating environments that can retain information across multiple requests.

    [ Team LiB ] Previous Section Next Section