+ للبحث عن الأحرف التي تحدث مرة واحدة أو أكثر. هناك أيضًا خيار يطابق الأحرف التي تحدث صفرًا أو أكثر. الحرف للقيام بذلك هو asterisk أو star : * . let soccerWord = "gooooooooal!"؛
دعونا gPhrase = "الشعور الغريزي" ؛
دع oPhrase = "فوق القمر" ؛
اترك goRegex = / go * /؛
soccerWord.match (goRegex)؛ // Returns ["goooooooo"]
gPhrase.match (goRegex)؛ // Returns ["g"]
oPhrase.match (goRegex)؛ // يعود لاغيا
chewieRegex يستخدم الحرف * لتطابق كافة الأحرف "a" العلوي والسفلي في chewieQuote . لا يحتاج تعبيرك العادي إلى علامات ، ولا ينبغي أن يتطابق مع أي من علامات الاقتباس الأخرى. chewieRegex * لمطابقة صفر أو أكثر a الأحرف.
testString: 'assert(/\*/.test(chewieRegex.source), "Your regex chewieRegex should use the * character to match zero or more a characters.");'
- text: يجب أن يتطابق التعبير العادي regex chewieRegex مع 16 حرفًا.
testString: 'assert(result[0].length === 16, "Your regex chewieRegex should match 16 characters.");'
- text: يجب أن يتطابق "Aaaaaaaaaaaaaaaa" العادي مع "Aaaaaaaaaaaaaaaa" .
testString: 'assert(result[0] === "Aaaaaaaaaaaaaaaa", "Your regex should match "Aaaaaaaaaaaaaaaa".");'
- text: 'يجب ألا يتطابق تعبيرك المعتاد مع أي أحرف في "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: 'يجب ألا يتطابق "Let him have it. It's not wise to upset a Wookiee." المعتاد مع أي أحرف في "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."");'
```