--- id: 587d7db4367417b2b2512b92 title: Extract Matches challengeType: 1 videoUrl: '' localeTitle: استخراج مباريات --- ## Description
حتى الآن ، كنت تتحقق فقط مما إذا كان هناك نمط موجود أم لا داخل سلسلة. يمكنك أيضًا استخراج التطابقات الفعلية التي وجدتها مع طريقة .match() . لاستخدام طريقة .match() ، قم بتطبيق الطريقة على سلسلة وتمريرها في regex داخل الأقواس. إليك مثال على ذلك:
"مرحبا ، العالم!". المباراة (/ مرحبا /) ؛
// إرجاع ["مرحبًا"]
دع ourStr = "التعبيرات العادية"؛
اسمحوا ourRegex = / تعبيرات / ؛
ourStr.match (ourRegex)؛
// إرجاع ["التعبيرات"]
## Instructions
قم .match() طريقة .match() لاستخراج كلمة coding .
## Tests
```yml tests: - text: و result يجب أن يكون كلمة coding testString: 'assert(result.join() === "coding", "The result should have the word coding");' - text: يجب أن يبحث codingRegex regex codingRegex عن coding testString: 'assert(codingRegex.source === "coding", "Your regex codingRegex should search for coding");' - text: يجب عليك استخدام طريقة .match() . testString: 'assert(code.match(/\.match\(.*\)/), "You should use the .match() method.");' ```
## Challenge Seed
```js let extractStr = "Extract the word 'coding' from this string."; let codingRegex = /change/; // Change this line let result = extractStr; // Change this line ```
## Solution
```js // solution required ```