2018-10-12 15:37:13 -04:00
---
title: Extract Matches
---
2019-07-24 00:59:27 -07:00
# Extract Matches
2018-10-12 15:37:13 -04:00
2019-07-24 00:59:27 -07:00
---
## Problem Explanation
2018-10-12 15:37:13 -04:00
Using the `match()` method, you can extract parts of a string that match with your regular expression. In this challenge, you are extracting the word "coding" from the string provided.
2019-07-24 00:59:27 -07:00
---
## Hints
### Hint 1
2018-10-12 15:37:13 -04:00
Change your regex to detect the word "coding".
2019-07-24 00:59:27 -07:00
### Hint 2
2018-10-12 15:37:13 -04:00
Did you call the `match()` method on the string?
2019-07-24 00:59:27 -07:00
---
## Solutions
< details > < summary > Solution 1 (Click to Show/Hide)< / summary >
2018-10-12 15:37:13 -04:00
```javascript
let extractStr = "Extract the word 'coding' from this string.";
2019-07-24 00:59:27 -07:00
let codingRegex = /coding/;
let result = extractStr.match(codingRegex);
2018-10-12 15:37:13 -04:00
```
2019-07-24 00:59:27 -07:00
< / details >