JavaScript Regular Expressions and Text Formatting for Pythonistas (Summary)

The payments team’s Friday release notes now come from JavaScript. With the “Other commits” section from the last exercise in place, release-notes.js prints the same eleven lines as release_notes.py for week 45, from Release payments-2026.11.06 down to mentions PAY-2304. The reverted PAY-2288 still shows up as a revert rather than a change that shipped.

Along the way, you’ve learned to:

  • Line up columns with .padStart() and .padEnd(), turning a number into text with String() first
  • Write regex literals such as /^(PAY-\d+): (.+)/i, and say where a match must be with ^ and $
  • Build a pattern from a setting with new RegExp() and String.raw, with its flags as letters
  • Read the result of .match() without g: an array with the whole match at [0] and the groups after it, or null when nothing matches
  • Name groups with (?<name>...) and loop over every commit with .matchAll() and the g and m flags
  • Rewrite text with .replace(), using g for every match and $<name> in the replacement

Most of those skills came from catching a Python habit that didn’t carry over.

Keep and Drop Your Python Habits

Locked learning resources

Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Locked learning resources

The full lesson is for members only. Join us and get access to thousands of tutorials and a community of expert JavaScript developers.

Unlock This Lesson

Already a member? Sign-In

Become a Member to join the conversation.