From 36a4df9afa44a540c1ffdb5357748eaadbaadbc1 Mon Sep 17 00:00:00 2001 From: Daniella Todd Date: Wed, 1 May 2019 11:48:31 +0100 Subject: [PATCH] Updated solution-Include intro (#34199) (#34486) Added intro paragraph and further hints. --- .../check-for-all-or-none/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none/index.md b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none/index.md index b7f12464e3..613f4c130e 100644 --- a/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none/index.md +++ b/guide/english/certifications/javascript-algorithms-and-data-structures/regular-expressions/check-for-all-or-none/index.md @@ -2,17 +2,17 @@ title: Check for All or None --- ## Check for All or None +In this challenge, you are asked to change the regex so that it defines the existence of the letter u, resulting in the acceptance of both American and British versions of the word favourite/favorite. -With Regular Expressions (RegExp) you can have modify your testing pattern with special charaters. To pass this challenge you the __quantifiers__ are very helpful. A quantifier is __?__ in __x?__. +### Hint 1: +The variable favWord already contains the American version — favorite. Does the regular expression in favRegex also match the British version? -__x?__ Matches the preceding item x 0 or 1 time. +### Hint 2: +Have you used the question mark, ? symbol, if so, have you placed it in the correct position? -For example, /e?le?/ matches the "el" in "angel" and the "le" in "angle." +### Spoiler Alert - Solution Ahead! -If used immediately after any of the quantifiers *, +, ?, or {}, makes the quantifier non-greedy (matching the minimum number of times), as opposed to the default, which is greedy (matching the maximum number of times). - - -__Challenge Solution:__ +## Solution ```javascript let favWord = "favorite";