pull/795/merge
evabth 1 month ago committed by GitHub
commit 1e96761ff8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -313,13 +313,13 @@ const pattern = /\d+/g // d is a special character which means digits
const txt = 'This regular expression example was made in January 12, 2020.'
const matches = txt. match(pattern)
console.log(matches) // ["12", "2020"], this is not what we want
console.log(matches) // ["12", "2020"], this is what we want
```
### One or more times(+)
```js
const pattern = /\d+/g // d is a special character which means digits
const pattern = /\d+/g // + is a special character that matches one or more occurences of the preceding element
const txt = 'This regular expression example was made in January 12, 2020.'
const matches = txt. match(pattern)
console.log(matches) // ["12", "2020"], this is not what we want

Loading…
Cancel
Save