changes in regular expression

changed from "let regEx = /\d+/" to "let regEx = /\d/g" to match the output like this ["2", "0", "1", "9", "3", "0", "2", "0", "2", "0"];
pull/211/head
DivyeshGolani 4 years ago committed by GitHub
parent ff64df9419
commit 2a8822fb48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -763,7 +763,7 @@ Let us extract numbers from text using a regular expression. This is not the reg
```js ```js
let txt = 'In 2019, I ran 30 Days of Python. Now, in 2020 I am super exited to start this challenge' let txt = 'In 2019, I ran 30 Days of Python. Now, in 2020 I am super exited to start this challenge'
let regEx = /\d+/ let regEx = /\d/g
// d with escape character means d not a normal d instead acts a digit // d with escape character means d not a normal d instead acts a digit
// + means one or more digit numbers, // + means one or more digit numbers,

Loading…
Cancel
Save