--- id: 587d7db8367417b2b2512ba3 title: Match Whitespace challengeType: 1 videoUrl: '' localeTitle: تطابق الفراغ --- ## Description
غطت التحديات حتى الآن الحروف المطابقة للأبجدية والأرقام. يمكنك أيضًا مطابقة المسافة البيضاء أو المسافات بين الأحرف. يمكنك البحث عن المسافات باستخدام \s ، وهي صغيرة s . لا يطابق هذا النمط المسافة البيضاء فحسب ، بل يطابق أيضًا أحرف الإرجاع ، وعلامة التبويب ، وتغذية النموذج ، وأحرف الخطوط الجديدة. يمكنك اعتباره مشابهًا لفئة الأحرف [ \r\t\f\n\v] .
let whiteSpace = "Whitespace. Whitespace everywhere!"
اترك spaceRegex = / \ s / g؛
whiteSpace.match (spaceRegex)؛
// عائدات [" "، " "]
## Instructions
غيّر countWhiteSpace regex للبحث عن أحرف بيضاء متعددة في سلسلة.
## Tests
```yml tests: - text: يجب أن يستخدم تعبيرك العادي العلم العام. testString: 'assert(countWhiteSpace.global, "Your regex should use the global flag.");' - text: يجب أن يستخدم تعبيرك العادي الحرف المختصر testString: 'assert(/\\s/.test(countWhiteSpace.source), "Your regex should use the shorthand character \s to match all whitespace characters.");' - text: يجب أن يعثر تعبيرك المعتاد على ثماني مساحات في "Men are from Mars and women are from Venus." testString: 'assert("Men are from Mars and women are from Venus.".match(countWhiteSpace).length == 8, "Your regex should find eight spaces in "Men are from Mars and women are from Venus."");' - text: 'يجب أن يعثر تعبيرك المعتاد على ثلاث مسافات في "Space: the final frontier."' testString: 'assert("Space: the final frontier.".match(countWhiteSpace).length == 3, "Your regex should find three spaces in "Space: the final frontier."");' - text: يجب ألا يجد "MindYourPersonalSpace" أي مسافات في "MindYourPersonalSpace" testString: 'assert("MindYourPersonalSpace".match(countWhiteSpace) == null, "Your regex should find no spaces in "MindYourPersonalSpace"");' ```
## Challenge Seed
```js let sample = "Whitespace is important in separating words"; let countWhiteSpace = /change/; // Change this line let result = sample.match(countWhiteSpace); ```
## Solution
```js // solution required ```