JavaScript Regular Expressions and Text Formatting for Pythonistas (Summary)

Congratulations, you made it to the end of the course! The payments team’s Friday release notes now come from JavaScript. Once you finished the “Other commits” section in the last exercise, release-notes.js printed the same eleven lines as release_notes.py for week 45, from Release payments-2026.11.06 down to mentions PAY-2304. It printed the same section for last week’s log too.

The lead can post the port’s notes in the team chat as before, and the reverted PAY-2288 still shows up under “Other commits:” with its mention, instead of being announced as a change that shipped.

In this course, you learned how to:

  • Line up columns with .padStart() and .padEnd(), and zero-pad a number by turning it into a string with String() first
  • Write a regex literal, such as /^(PAY-\d+): (.+)/i, and say where a match must start and end with ^ and $
  • Build a pattern from a letters-only setting such as TEAM with new RegExp() and String.raw, with its flags as letters, like "i"
  • Read a match with .match() without g, as an array indexed like Python’s groups, or as null when nothing matches
  • Name groups with (?<name>...), read them from .groups, and loop over every commit in the log with .matchAll() and the g and m flags
  • Rewrite text with .replace(), using g to replace every match and $<name> to rearrange named groups

Keep the Habits That Make Patterns Port

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.