JavaScript Regular Expressions and Text Formatting for Pythonistas

Stephen Gruppetta 15 Lessons 2h 34m Updated intermediate js py

On plain text, JavaScript’s regular expressions read almost exactly like Python’s, so the slips are in everything around the pattern, and most of them still print something plausible. Port TICKET.match(subject) as TICKET.test(subject), and a revert commit slips into the release notes as a ticket, because re.match() only matches at the start of the text and test() searches anywhere.

In this course, you’ll port a payments team’s Friday script that turns the week’s git log into release notes for the team chat.

By the end of this course, you’ll be able to:

  • Line up columns with padStart() and padEnd() instead of Python’s format specs
  • Test text against a regex literal, and build a pattern from a variable with new RegExp()
  • Pull out matches and named groups from one line or a whole log
  • Tidy and rewrite text with regex replacements
  • Port the whole release-notes script to JavaScript

You’ll need Python’s format specs, such as :02d and :<36, and its re module: match(), finditer(), named groups, and sub(). You’ll also need Node 26 and JavaScript’s template literals, Intl.NumberFormat, and string methods such as slice(), replace(), and split(). The Python examples use Python 3.15.

The course mixes short videos and text lessons with exercises, a project that ports the whole script, and a quiz.

What’s Included:

  • 15 Lessons
  • Video Subtitles and Full Transcripts
  • Translated Subtitles in 8 Languages
  • 2 Downloadable Resources
  • Interactive Quiz to Check Your Progress
  • 5 Hands-On Coding Exercises
  • Q&A With JavaScript Experts: Ask a Question
  • Certificate of Completion

Downloadable Resources:

Related Learning Paths:

About Stephen Gruppetta

Stephen obtained a PhD in physics and worked as a physicist in academia for over a decade before becoming a programming educator. He's constantly looking for simple ways to explain complex things.

» More about Stephen

← Browse All Courses