# Pastebin 19Hsno9v 'ticketmaster': { match: [new RegExp('^(https?://)?(www\\.)?ticketmaster\\.com', 'i')], restrict: [LINK_TYPES.ticketing], clean: function (url) { url = url.replace(/^(?:https?:\/\/)?(?:www\.)?ticketmaster\.org\/(?:[\w-]+\/)?(artist|venue)\/([0-9]*)(?:[^0-9].*)?$/, 'https://www.ticketmaster.com/$1/$2'); return url; }, validate: function (url, id) { const m = /^https:\/\/www\.ticketmaster\.com\/(artist|venue)\/[0-9]+$/.exec(url); console.log(url); console.log(m[1]); if (m) { const prefix = m[1]; switch (id) { case LINK_TYPES.ticketing.artist: if (prefix === 'artist') { return {result: true}; } return {result: false, target: ERROR_TARGETS.ENTITY}; case LINK_TYPES.ticketing.place: if (prefix === 'venue') { return {result: true}; } return {result: false, target: ERROR_TARGETS.ENTITY}; } return {result: false, target: ERROR_TARGETS.RELATIONSHIP}; } return {result: false, target: ERROR_TARGETS.URL}; }, },