Regular Expressions for Dummies
videos

Regular Expressions for Dummies: Screencast Series

Over the course of a handful of video tutorials, I’m going to teach you how to use regular expressions effectively in your Javascript and PHP applications. As always, I’ll assume you know absolutely zip.

Editor’s note – this series has been transferred to Nettuts+ from our sister site, ThemeForest. It was originally published in early 2009 by yours truly.

Lesson 1: Introduction

Lesson 2: Matching

Lesson 3: Validating Email Addresses

Lesson 4: Javascript and “Replace”

Lesson 5: Preg_match_all, and Scraping Data


Add Comment

Discussion 22 Comments

  1. David Moreen says:

    Oh man Jeffrey, I needed this really bad. One thing that I still have yet to master/learn and don’t look forward to is regular expressions. I suppose now is a better time then ever…

  2. Joao Aliano says:

    love them meat ‘n potatoz
    reg ex with lotsa gravyie, plz

  3. Fahim says:

    Hey Jeffrey, loving the videos especially about this topic. It can be so powerful once you grasp the findementals.

    If you can, it would be nice if you could do a short video tutorial on how to apply this on .htaccess files for redirecting, clean urls etc.

    Keep up the good work.

    Fahim (http://fswebsolutions.com)

  4. parvez says:

    oh really love it :0 thanks man u great :D

  5. Sajid Ali says:

    Thank you very much, i was hoping for such a great tutorial.

    Really helpful.

  6. Anonymous says:

    As you have told in the beginning,
    “this series has been transferred to Nettuts+ from our sister site, ThemeForest.”

    I would like the actual ThemeForest links for all 5 video, so i can go there and see the actual comments that users had made.

    I hope it can help us.

  7. David says:

    How come I get an error.

    undifined variable? I think I am ready to retire. I’ll go and bother my wife for few hours. Maybe, That makes me happy for a while. Stress!!

    $test = ‘model1=David1&listed1=555.00&net1=555.00&model2=David1&listed2=555.00&net2=555.00′;

    preg_match_all(‘/-\d+\=/i’, $test, $sorted_new);

    foreach($sorted_new[1] as $str) {
    echo $str.”";
    }

  8. Radoslav says:

    David, you search for matches[1], but no “()” was defined in pattern :) close the sting in () what you want…

  9. Dan says:

    For some reason I can’t get the ^ symbol to work for the patterns beginning. eg ^cat for pattern

    catmobile cats r us cat catch cat. Does that one not work?

  10. Prosper says:

    I like this tutorial but I was wondering how I can get content wrapped in div tags

    example

  11. abdelhakim knis says:

    i really appriciate your efforts jeff and i hope th

  12. abdelhakim knis says:

    i really appriciate your efforts jeff and big thanks.
    I have a littele problem that i can’t watch the screencasts ,there is no streaming;so would you please fix that probleme because i really learned a lot of stuff from the tuts network.

  13. Man Ive been looking for a set of tutorials like these. Ive found others but most just are clear and to the point.

    Thank You Thank You Thank You So MUCH!!!
    Jose

  14. Lorenzo Peña Álvarez says:

    I can’t view number the number 4 and number 5 :( Maybe the link is not working or it just got deleted. Is there any other place where I can watch them?

    Thanks

  15. Rod Elias says:

    Hi Jeffrey.
    Thank you very much for posting such a great and useful screencasts.
    I got this little note here:
    In Lesson 3 (Validating Email Addresses) we can also have strings such as rod@wgo.com.br
    Therefore, I think one more precise regular expression for matching that would be something like:
    \b[\w-]+@[\w-]+\.[A-Za-z_-]+[.A-Za-z]*\b

    That’s it and keep up the good work.

    rod~

  16. Sathish says:

    Great Tutorials.. Until now regular expressions were some weird characters to me.. Now things start to make sense.. Thanks a ton..

  17. roNn23 says:

    Wow, what great tutorials!
    Regex was only hieroglyphics for me until now. Thanks a lot!

  18. Elaine says:

    Very useful indeed! Thanks :)

  19. simply awesome !
    Thanks also it release for all kinds of user without paying a single cent !!!

  20. d3nnnis says:

    Well explained tutorials! Just what i needed :)

    Really thank you!

Add a Comment

To add a code snippet to your comment, please wrap your code like so: <pre name="code" class="html">YOUR CODE</pre>. You can replace the class name with "js," "css," "sql," or "php." If there are any "<" or ">" within your code, please search and replace them with: &lt; and &gt; respectively.