Regex for Dummies: Day 4

We’ll be focusing specifically on Javascript and jQuery today, as we learn how to replace strings of text. Then, in a strange turn that has no place in the video, we’ll review how to correctly access the event object in all browsers (when using pure Javascript).

Day 4: Javascript and “Replace”

Be sure to click on the “Full Screen Toggle”.


  • Meshach says:

    Jeffrey’s done it again!

    Well done Jeffrey! :)

  • Vasili says:

    I thought that mini JavaScript lesson was very informal. :) What happened to the quiz today?

  • SX says:

    Thanks a lot Jeffrey. Good times. :)

  • Tom says:

    Does the regular expressions things finished? I mean I wanted to see JS with REGEX and you just did a lot of optional JS explanation :( after doing the useful thing for RegEx

    Really like to continue learning regex!

  • Rhonda says:

    Thanks for the tut, Jeffrey! Enjoyed the bonus tut on handling browser differences as well.

  • Unfortunately i agree with Tom, there was little in there moving forward with Regex. I was excited to see that the the video was over 17 min, but only a 3rd of it was on Regex, the rest on jQuery and java script..

    will still check out future videos in this series.

  • Shaun C. says:

    This was like two screencasts in one :D

    Thanks Jeff!!

  • Phil says:

    Love the video. All of them, actually.
    Thanks for putting them out there :) .

  • Mike says:

    What happened to Diving into PHP Series?

  • Branden says:

    Thanks for the Javascript bit. It’s useful and something I didn’t originally know. Love the Regex stuff too. I’ve been using regexbuddy lately trying to get the jist of it. Works well but the jargon is still a little confusing. I’m slowly catching on though.

  • Meshach says:

    @Tom @Jamie: Your guy’s comments were pretty lame.. The tutorials are absolutely free. Why pester him about it, he’s helping you and you’re complaining.

    Keep up the great work Jeffrey.

  • Matt says:

    Is it just me, or is the video not showing up in the browser? I can’t watch it!

  • Fawaz says:

    Matt it works great on my browser.

    btw: Jeffrey this is a great tutorial

  • Ethan says:

    Great tutorial. But why all the stuff about an event handler bug at the end, when you should use event listeners most of the time anyway (although they’re buggy in ie too).

  • Nat says:

    Hello Jeff, I think there’s a little problem. I see “Wordpress for Designers : day 12″ instead of seeing Regex : day 4.

    If you could fix the problem, it would be great, can’t wait to see Regex Day 4.

    Thank you

    PS : love the series, as usual. Fantastic job

  • Kevin says:

    Hi Jeff!

    Excellent again,

    I’m looking for some date validation now. How do I write a RegEx that validates a date for:

    A. ensuring the date is not in the past.
    B. ensuring the date is not beyond a certain future window (say 3 months)

    Keep it up!


  • @Meshach it’s just constrictive criticism mate. Maybe read my other comments on the other videos. Read between the lines.

  • Michael says:


    The task you are trying to accomplish is something outside the capacity of regular expressions. Regexes can’t tell time.

  • ozdemir says:

    Hi Jeff ,

    thx for the videos. all of them are awesome..

    btw, do you know how to select text outside of html tags..

    xxxx asdasd yyyy

    how can i select only xxxx and yyyy ?

  • Kevin says:

    Awesome tutorial, can’t wait for day 5. This has really helped.

  • Herman says:

    Whats the difference between \W and ^\w

  • Ahmad Alfy says:

    Awesome Jeff!

    First I though you would be going through browser sniffing!

    but I loved the way you did it :D

    Keep it up!

  • Ahmad Alfy says:

    Awesome Jeff!

    First I though you would be going through browser sniffing!

    but I loved the way you did it :D

    Keep it up!