JavaScript regex to standardize US zipcode
I can't figure out whats what with a regex. The simplest reproduction is this failed match where I would expect that 3rd capture group to be 'A'.: > console.log('00000-0000A'.match(/(D)s*(d{5}-d{4})s*(D)/g)); null undefined Additional context includes: const standardizeZipcode = (str: string) =>…