O'Reilly logo

Pro PHP and jQuery by Jason Lengstorf

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

Chapter 9. Performing Form Validation with Regular Expressions

It's your responsibility as a developer to ensure that your users' data is useful to your app, so you need to ensure that critical information is validated before storing it in your database.

In the case of the calendar application, the date format is critical: if the format isn't correct, the app will fail in several places. To verify that only valid dates are allowed into the database, you'll use regular expressions (regexes), which are powerful pattern-matching tools that allow developers much more control over data than a strict string comparison search.

Before you can get started with adding validation to your application, you need to get comfortable using regular expressions. In ...

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