Hi everyone. I originally released this screencast back when this blog only had about two hundred subscribers. Lately, many of our new readers have been asking me about using regular expressions. So, I decided to bump this one back to the top. I hope you enjoy it!

To a novice web developer, regular expressions look like the most scary thing on the planet. Who could possibly dismantle such a block of code and decipher its meaning? Luckily, its bark is much worse than its bite. You’ll quickly find that regular expressions are rather straight-forward and easy to understand - once you learn the syntax.

Click on the “Toggle” to view the video in full screen.

Additional Resources

  • Regular Expressions Cheat Sheets

    Regular Expressions Cheat Sheets

    Whether you’re searching strings or validating input fields, the use of regular expressions will save you a great deal of time. I found a great cheat sheet from AddedBytes.com that should save you a great deal of time. It’s a free PDF download, so get to it!

    Visit Article

  • Using Regular Expressions with PHP

    Using Regular Expressions with PHP

    This site specializes in all things related to “regular expressions”. It should be your first stop on your learning question.

    Visit Article

  • Using Regular Expressions with PHP

    PHP Regular Expression Tutorial

    Regular expressions are a powerful tool for examining and modifying text. Regular expressions themselves, with a general pattern notation almost like a mini programming language, allow you to describe and parse text. They enable you to search for patterns within a string, extracting matches flexibly and precisely.

    Visit Article

  • Using Regular Expressions with PHP

    Using Regular Expressions with PHP

    In this article I will show you how to use PHP regular expressions in your own PHP scripts.

    Visit Article

Comments

Leave a Comment
  1. Bad choice in pictures for open

  2. Nice tutorial, thanks ;)

  3. thanks for the nice tut, explained everything :)

    at the part where the regex for email addreses is done there a missing $ sign at the end,…
    so it not only will valitate “sitemanager@themeforest.net” but also “sitemanager@themeforest.net something else here” ??

    here some examples which would be valid email addresses but invalid acording to the used regex,…

    email@some-site.com
    email@blog.somesite.com
    email@somesite.co.uk (same ideea as above)

    i think this would be a better regex for emails,.. please correct me if im wrong

    \^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$\

  4. Gravatar

    Juan Barrientos

    Nice!

  5. Jeff, I really love your screencasts, you’re really good at explaining things!

    Keep up the good work

  6. Another excellent video tutorial clearing up my confusion over Regular Expressions. I have “Mastering Regular Expressions” by Friedel and got lost somewhere in there. You have opened another door for me. Thanks

  7. It is such a relief to have discovered your tutorials which do improve my learning curve drastically

  8. Gravatar

    George Hennessy

    Outdated tutorial.

  9. Another great eye opener.

    Thank you very much.

  10. Thanks Jeffrey, I was making a contact form today and this came in handy.

Add a Comment

Name Email Website

Note: The avatars shown next to comments are Gravatars. You can get a Gravatar account for free and any other site that supports it will show your avatar too!

 

Trackbacks

Leave a Trackback