// Practice Set · JS RegExp · guest

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

Question 1 of 5 from: JS RegExp Flags

What does this log?

console.log("red, green, red".replace(/red/, "RED"), "red, green, red".replace(/red/g, "RED"));
Question 2 of 5 from: JS RegExp Classes

What does this log?

const word = "caf\u00e9";
console.log(word.match(/\w+/)[0].length, word.match(/\p{L}+/u)[0].length);
Question 3 of 5 from: JS RegExp Metachars

What does this log?

console.log(/3.14/.test("3514"), /3\.14/.test("3514"), /3\.14/.test("3.14"));
Question 4 of 5 from: JS RegExp Metachars

What does this log?

console.log("Give 100%!".match(/\W/g));
Question 5 of 5 from: JS RegExp Assertions

/\d{5}/ accepts "my zip is 212019999 thanks" as a zip code, which is why validation patterns need ^ and $.

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.