--- id: 587d7db8367417b2b2512ba0 title: Match Everything But Letters and Numbers challengeType: 1 videoUrl: '' localeTitle: تطابق كل شيء لكن الحروف والأرقام --- ## Description
لقد تعلمت أنه يمكنك استخدام اختصار لمطابقة [A-Za-z0-9_] الأبجدية العددية [A-Za-z0-9_] باستخدام \w . النمط الطبيعي الذي قد ترغب في البحث عنه هو عكس alphanumerics. يمكنك البحث عن عكس \w مع \W لاحظ أن النمط المعاكس يستخدم حرفًا كبيرًا. هذا الاختصار هو نفسه [^A-Za-z0-9_] .
اترك shortHand = / \ W /؛
السماح للأرقام = "42 ٪" ؛
اسمحوا الجملة = "الترميز!" ؛
numbers.match (اختزال)؛ // عائدات ["٪"]
sentence.match (اختزال)؛ // عائدات ["!"]
## Instructions
استخدم class \W حرف الاختصار لحساب عدد الأحرف غير الأبجدية الرقمية في علامات الاقتباس والسلاسل المختلفة.
## Tests
```yml tests: - text: يجب أن يستخدم تعبيرك العادي العلم العام. testString: 'assert(nonAlphabetRegex.global, "Your regex should use the global flag.");' - text: يجب أن يعثر تعبيرك المنطقي على 6 أحرف غير أبجدية رقمية في "The five boxing wizards jump quickly." . testString: 'assert("The five boxing wizards jump quickly.".match(nonAlphabetRegex).length == 6, "Your regex should find 6 non-alphanumeric characters in "The five boxing wizards jump quickly.".");' - text: يجب أن يستخدم تعبيرك العادي الحرف المختصر. testString: 'assert(/\\W/.test(nonAlphabetRegex.source), "Your regex should use the shorthand character to match characters which are non-alphanumeric.");' - text: يجب أن يعثر تعبيرك المنطقي على 8 أحرف غير أبجدية رقمية في "Pack my box with five dozen liquor jugs." testString: 'assert("Pack my box with five dozen liquor jugs.".match(nonAlphabetRegex).length == 8, "Your regex should find 8 non-alphanumeric characters in "Pack my box with five dozen liquor jugs."");' - text: يجب أن يعثر تعبيرك المنطقي على 6 أحرف غير أبجدية رقمية في "How vexingly quick daft zebras jump!" testString: 'assert("How vexingly quick daft zebras jump!".match(nonAlphabetRegex).length == 6, "Your regex should find 6 non-alphanumeric characters in "How vexingly quick daft zebras jump!"");' - text: يجب أن يعثر "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ." على 12 حرفًا غير أبجدي رقمي في "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ." testString: 'assert("123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ.".match(nonAlphabetRegex).length == 12, "Your regex should find 12 non-alphanumeric characters in "123 456 7890 ABC def GHI jkl MNO pqr STU vwx YZ."");' ```
## Challenge Seed
```js let quoteSample = "The five boxing wizards jump quickly."; let nonAlphabetRegex = /change/; // Change this line let result = quoteSample.match(nonAlphabetRegex).length; ```
## Solution
```js // solution required ```