JavaScript Regular Expressions and Text Formatting for Pythonistas Quiz

Interactive Quiz ⋅ 9 Questions
By Stephen Gruppetta

In this quiz, you’ll test your understanding of JavaScript Regular Expressions and Text Formatting for Pythonistas.

By working through this quiz, you’ll revisit how padStart() pads a number’s text, where test() looks for a match and how ^ ports re.match(), how String.raw builds a pattern from a setting, how to read groups by number and by name, and when JavaScript needs the g flag to find or replace every match.

Most questions show a short snippet ported from Python and ask what it does in JavaScript, or which version gives the same answer as the Python script. Good luck!

The quiz contains 9 questions and there is no time limit. You’ll get 1 point for each correct answer. At the end of the quiz, you’ll receive a total score. The maximum score is 100%. Good luck!

Related Resources

A developer points at a magnifying lens on a RegExp tower that highlights PAY-2304 in a scrolling log, between a matchAll() intake, a replace() stamping arm and a padEnd() tray of aligned rows.

Course

JavaScript Regular Expressions and Text Formatting for Pythonistas

Port a payments team's release-notes script from Python to JavaScript, and learn to line up text in columns and to test, extract, and rewrite text with JavaScript's regular expressions.

intermediate js py