$ node > let XRegExp = require('xregexp'); > XRegExp.exec('02-14-1924', XRegExp(` (?<day> \\d{2} ) - (?<mon> \\d{2} ) - (?<year> \\d{4} ) `, 'x')) [ '02-14-19', '02', '14', '1924', index: 0, input: '02-14-1924', groups: undefined, day: '02', mon: '14', year: '1924' ]