freeCodeCamp/curriculum/challenges/arabic/02-javascript-algorithms-an.../regular-expressions/match-single-characters-not...

2.4 KiB

id title challengeType videoUrl localeTitle
587d7db6367417b2b2512b98 Match Single Characters Not Specified 1 مطابقة أحرف مفردة غير محددة

Description

حتى الآن ، قمت بإنشاء مجموعة من الأحرف التي تريد مطابقتها ، ولكن يمكنك أيضًا إنشاء مجموعة من الأحرف التي لا تريد مطابقتها. تسمى هذه الأنواع من مجموعات negated character sets . لإنشاء مجموعة negated character set ، تضع caret ( ^ ) بعد قوس الفتح وقبل الأحرف التي لا تريد مطابقتها. على سبيل المثال ، يطابق /[^aeiou]/gi كافة الأحرف التي ليست حرف علة. لاحظ أن أحرف مثل . ! تتم مطابقة ، [ ، @ ، / وفضاء أبيض] - تستبعد مجموعة أحرف العلة المنسوخة أحرف الأحرف المتحركة فقط.

Instructions

قم بإنشاء تعبير عادي واحد يتطابق مع كل الحروف التي ليست رقمًا أو حرفًا متحركًا. تذكر تضمين الأعلام المناسبة في التعابير المنطقية.

Tests

tests:
  - text: يجب أن يتطابق <code>myRegex</code> مع 9 عناصر.
    testString: 'assert(result.length == 9, "Your regex <code>myRegex</code> should match 9 items.");'
  - text: يجب أن يستخدم <code>myRegex</code> regex العلامة العامة.
    testString: 'assert(myRegex.flags.match(/g/).length == 1, "Your regex <code>myRegex</code> should use the global flag.");'
  - text: يجب أن يستخدم <code>myRegex</code> regex <code>myRegex</code> حالة الأحرف.
    testString: 'assert(myRegex.flags.match(/i/).length == 1, "Your regex <code>myRegex</code> should use the case insensitive flag.");'

Challenge Seed

let quoteSample = "3 blind mice.";
let myRegex = /change/; // Change this line
let result = myRegex; // Change this line

Solution

// solution required