From 9ebc54e9d5ba836f5659f358a33022fb3e8c0d56 Mon Sep 17 00:00:00 2001 From: Mario Kandut Date: Fri, 21 Dec 2018 02:25:09 +0100 Subject: [PATCH] add: stub for regexp challenge - check for all or none (#31670) --- .../check-for-all-or-none/index.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 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 e521ccdca7..b7f12464e3 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 @@ -3,11 +3,17 @@ title: Check for All or None --- ## Check for All or None +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: -The difference between american and british English for the given word is: favorite-favourite. We need to define the existance of the letter u . +__x?__ Matches the preceding item x 0 or 1 time. + +For example, /e?le?/ matches the "el" in "angel" and the "le" in "angle." + +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"; let favRegex = /favou?rite/; // Change this line