2.5: Regular Expressions: Back References – Programming with Text

In this short tutorial, I explain the concept of “back references” and explore how they are used to match the characters previously matched by capturing parentheses (groups) in a regular expression (regex).

This is the fifth video in a series on Regular Expressions, which is part of the “Programming from A to Z” course at ITP (

Next Video:

Course url:

Support this channel on Patreon:

Send me your questions and coding challenges!:


GitHub Repo with all the info for Programming from A to Z:

Links discussed in this video:
MDN’s Regular Expressions Reference:
Regular Expressions on Wikipedia:
Book Mastering Regular Expressions:
ITP from Tisch School of the Arts:

Source Code for the all Video Lessons:


For More Programming from A to Z videos:

For More Coding Challenges:

Help us caption & translate this video!






4 responses to “2.5: Regular Expressions: Back References – Programming with Text”

  1. Brendon Ballantyne Avatar

    Still wide awake.. 5 videos in and it all still makes sense!

  2. dandyandy Avatar

    Hello Daniel! One question: can you use quantifiers with back references? This video series was just what I needed, thanks!

  3. Everest Ev10 Avatar

    Hi daniel ! I really need you to answer this question.I Just coded a game in p5.js and i want to transfer dhe game to a buyer.How can i do that???(i dont know php or html just js so..)

  4. Collin Rea Avatar

    Thanks for the videos Daniel! You have a great way of teaching these subjects that can get very complicated quickly… I like how you break it down in to smaller sections and build on it. :thumbs-up:

Leave a Reply

Your email address will not be published. Required fields are marked *