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";