
commerce graduate | full time freelancer | full stack developer | proud father | ReactJS ReactNative NodeJS PHP
- Tweets81
- Following40
- Followers15
- Likes64
![This feature is about identifying capture groups via names. // Without named capture groups const re = /(\d{4})-(\d{2})-(\d{2})/; const match = re.exec('2021-03-04'); console.log(match[1]); // β 2021 (year) console.log(match[2]); // β 03 (month) console.log(match[3]); // β 04 (day) // With named capture groups π₯ const re = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/; const match = re.exec('2021-03-04'); console.log(match.groups.year); // β 2021 console.log(match.groups.month); // β 03 console.log(match.groups.day); // β 04 // ... and with destructuring assignment π₯π₯π₯ const [match, year, month, day] = re.exec('2021-03-04');](https://pbs.twimg.com/media/EzwqDp7VgAAQQnZ.jpg?name=small&format=webp)
ALT This feature is about identifying capture groups via names. // Without named capture groups const re = /(\d{4})-(\d{2})-(\d{2})/; const match = re.exec('2021-03-04'); console.log(match[1]); // β 2021 (year) console.log(match[2]); // β 03 (month) console.log(match[3]); // β 04 (day) // With named capture groups π₯ const re = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/; const match = re.exec('2021-03-04'); console.log(match.groups.year); // β 2021 console.log(match.groups.month); // β 03 console.log(match.groups.day); // β 04 // ... and with destructuring assignment π₯π₯π₯ const [match, year, month, day] = re.exec('2021-03-04');









