import * as regex_iterator from 'regex-iterator';
const spread_sample = () => {
const iterator = regex_iterator.create(/([0-9])([a-z])/g, '1a 2b 3c');
return [...iterator];
};
const take_sample = () => {
const iterator = regex_iterator.create(/([0-9])([a-z])/g, '1a 2b 3c');
return regex_iterator.take(
iterator,
match => match[2] !== 'c',
match => `${match[1]}-${match[2]}`,
);
};