I would like to extract the lastest zip code (5 digits) from a string who can contain multiple 5 digit. Actually i can extract only the first 5 digits.
var add = '15 castle street BP 44210 41000 NewYork xxx';
var regex = /d{5}/;
var result = add.match(regex);
console.log(result);
I got [44210] as result and i wish [41000]. Sometimes string contains only 1 zip code.