Skip to content

Commit

Permalink
add: stub for regexp challenge - check for all or none (#31670)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariokandut authored and RandellDawson committed Dec 21, 2018
1 parent 844f4ec commit 9ebc54e
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9ebc54e

Please sign in to comment.