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