1. CSS
  2. Flash
  3. HTML
  4. Illustrator
  5. Java
  6. JavaScript
  7. Maya
  8. Photography
  9. Photoshop
  10. PHP
  11. Ruby
  12. Ruby on Rails
  13. 3ds Max

PHP: Common Regular Expressions/Data Validation using RegEx

  1. Clicks today:
  2. Clicks this month:
  3. Overall rating:

PHP » Basics — almost 11 years ago
10 common regular expression for data validation


avatarrizwan6feb almost 11 years ago

This is a list of 10 commonly used regular expressions. Building a regular expression for email and url is never easy and they are never 100% correct. There is a trade-off between simplicity and efficiency/accuracy when working with complex regular expressions like this. So the regular expressions for email and URL validation presented here are tried to be as simple as possible and at the same time accurate and effienct as well. All these regular expressions are tested in PHP only (using preg_match).

Your Comment

You must be logged in to post a comment.