+
sign to look for characters that occur one or more times. There's also an option that matches characters that occur zero or more times.
The character to do this is the asterisk
or star
: *
.
let soccerWord = "gooooooooal!";
let gPhrase = "gut feeling";
let oPhrase = "over the moon";
let goRegex = /go*/;
soccerWord.match(goRegex); // Returns ["goooooooo"]
gPhrase.match(goRegex); // Returns ["g"]
oPhrase.match(goRegex); // Returns null
chewieRegex
that uses the *
character to match all the upper and lowercase "a"
characters in chewieQuote
. Your regex does not need flags, and it should not match any of the other quotes.
chewieRegex
should use the *
character to match zero or more a
characters.
testString: assert(/\*/.test(chewieRegex.source), 'Your regex chewieRegex
should use the *
character to match zero or more a
characters.');
- text: Your regex chewieRegex
should match 16 characters.
testString: assert(result[0].length === 16, 'Your regex chewieRegex
should match 16 characters.');
- text: Your regex should match "Aaaaaaaaaaaaaaaa"
.
testString: assert(result[0] === 'Aaaaaaaaaaaaaaaa', 'Your regex should match "Aaaaaaaaaaaaaaaa"
.');
- text: Your regex should not match any characters in "He made a fair move. Screaming about it can't help you."
testString: assert(!"He made a fair move. Screaming about it can\'t help you.".match(chewieRegex), 'Your regex should not match any characters in "He made a fair move. Screaming about it can't help you."
');
- text: Your regex should not match any characters in "Let him have it. It's not wise to upset a Wookiee."
testString: assert(!"Let him have it. It\'s not wise to upset a Wookiee.".match(chewieRegex), 'Your regex should not match any characters in "Let him have it. It's not wise to upset a Wookiee."
');
```