Following up from this thread, im trying to make this work
JavaScript regular expression to match X digits only
string = '2016-2022'
re = /\d{4}/g
result = string.matchAll(re)
The goal is to return [2016, 2022]
However it doesn't look like this is returning the desired results
I'm new to regular expression. What am I doing wrong?