re = new RegExp("musicbrainz\.org\/(release|artist)\/([a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12})","i"); var matches = window.location.href.match(re); if (matches) { var type = matches[1] var mbid = matches[2]; ('ul.tabs').append('Edit history'); }