Answers for "match city regex"

0

match city regex

const address = "One Infinite Loop, Cupertino 95014";
const cityZipCodeRegex = /^[^,\\]+[,\\\s]+(.+?)\s*(\d{5})?$/;
const [_, city, zipCode] = address.match(cityZipCodeRegex) || [];
saveCityZipCode(city, zipCode);
Posted by: Guest on September-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language