export const extractWithRegex = regex => (url) => {
  const match = url.match(regex);
  return match.length > 1 ? match[1] : '';
};

export const extractWithRegex = regex => (url) => {
  const match = url.match(regex);
  return match && match.length > 1 ? match[1] : '';
};

Check if match exists FIRST
fix(extractWithRegex): Check if match exists FIRST

Check if match exists before even checking it's length
