// Practice Set · JS RegExp (Part 2) · guest

Guest practice: this set is not saved and does not count.

Question 1 of 5 from: JS RegExp Groups

What does this log?

const m = "Due: 2026-10-02".match(/(\d{4})-(\d{2})-(\d{2})/);
console.log(m[0], m[2], m.length);
Question 2 of 5 from: JS RegExp Groups

What does this log?

console.log("Lovelace, Ada".replace(/(?<last>\w+), (?<first>\w+)/, "$<first> $<last>"), "2026-10-02".replace(/(\d{4})-(\d{2})-(\d{2})/, "$2/$3/$1"));
Question 3 of 5 from: JS RegExp Quantifiers

What does this log?

console.log("a aa aaa aaaa".match(/\ba{2,3}\b/g), "abc".match(/x*/g).length);
Question 4 of 5 from: JS RegExp Objects

/a/ === /a/ is true because both regexes have the same pattern.

Question 5 of 5 from: JS RegExp Methods

What does this log?

const s = "x=1, y=22";
console.log(s.match(/(\w)=(\d+)/), s.match(/(\w)=(\d+)/g), s.match(/z/));
Ready to submit?

Click a question to go back and check it. After you submit, you will see the right answer and an explanation for every question. As a guest, nothing is saved.