PHP Day 12: Basics of Regular Expressions
This eight-minute video shows how you can use regular expressions to validate input from an HTML form. It’s only an introduction to regular expressions, so see the links for more in-depth explanations.
Links for PHP Day 12: Basics of Regular Expressions
More on regular expression syntax:
- Regular Expressions Tutorial - A detailed tutorial from a site devoted to regular expressions.
- PHP Video Tutorials - Regular Expressions - A 40-minute video tutorial on using regular expressions with PHP.
Regular expression functions:
- PHP: Regular Expressions (Perl-Compatible) - Reference page for the PCRE functions from the PHP manual.
- PHP: Regular Expressions (POSIX Extended) - Also from the PHP manual, a reference page for the POSIX extended regex functions.
- PHP: preg_match - The one function I used today.
Regular expression reference pages:
- Regular Expression Library - Allows you to search for regular expressions for all sorts of uses.
- Regular Expressions in Perl - A summary of regex syntax, with examples at the bottom.
- PHP: Pattern Syntax - A really long reference page from the PHP manual explaining everything you ever wanted to know about regex syntax.
Oh, and here’s the scary regular expression from the beginning of the video, just in case you wanted to dissect it. (See you in ten years!)



July 12th, 2007
Cool tutorial. I like the way you keep it simple.
July 31st, 2008
The http://regexlib.com/ site is a great one. I still have a hard time with these.