From 2ba8f0aaaa9bfa25c0a86310ad49992f274b7265 Mon Sep 17 00:00:00 2001 From: Manish Giri Date: Thu, 2 Feb 2017 20:05:18 -0500 Subject: [PATCH] Improve instruction in regex match single character challenge --- .../regular-expressions.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json b/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json index a18c1cd3075..84f7b8b6fe1 100644 --- a/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json +++ b/challenges/02-javascript-algorithms-and-data-structures/regular-expressions.json @@ -248,7 +248,7 @@ "For example, you want to match \"bag\", \"big\", and \"bug\" but not \"bog\". You can create the regex /b[aiu]g/ to do this. The [aiu] is the character class that will only match the characters \"a\", \"i\", or \"u\".", "
let bigStr = \"big\";
let bagStr = \"bag\";
let bugStr = \"bug\";
let bogStr = \"bog\";
let bgRegex = /b[aiu]g/;
bigStr.match(bgRegex); // Returns [\"big\"]
bagStr.match(bgRegex); // Returns [\"bag\"]
bugStr.match(bgRegex); // Returns [\"bug\"]
bogStr.match(bgRegex); // Returns null
", "
", - "Use a character class with vowels (a, e, i, o, u) in your regex vowelRegex to count the number of vowels in the string quoteSample.", + "Use a character class with vowels (a, e, i, o, u) in your regex vowelRegex to find all the vowels in the string quoteSample.", "Note
Be sure to match both upper- and lowercase vowels." ], "challengeSeed": [ @@ -257,7 +257,7 @@ "let result = vowelRegex; // Change this line" ], "tests": [ - "assert(result.length == 25, 'message: The number of vowels you counted should be 25.');", + "assert(result.length == 25, 'message: You should find all 25 vowels.');", "assert(/\\[.*\\]/.test(vowelRegex.source), 'message: Your regex vowelRegex should use a character class.');", "assert(vowelRegex.flags.match(/g/).length == 1, 'message: Your regex vowelRegex should use the global flag.');", "assert(vowelRegex.flags.match(/i/).length == 1, 'message: Your regex vowelRegex should use the case insensitive flag.');",