View Evernote note via an Everynote Link

Everynote is a good "everything bucket" tool. I have begun to use it more and more for notes, tasks, etc. A feature of Evernote is that you can create Evernote Links. These links are URIs that reference a note, but only locally. However, it occurred to me that the data in the link could be used to create a URL to the same Everynote note as displayed on the web. The following is a bookmarklet that prompts for the link, converts it to a URL, and then directs the browser to view the page at the URL.
(function(){
var link_pattern = new RegExp(
"^evernote:\/"+
".*"+
"\/"+
"([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})"+
"\/"+
"([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})"+
"\/"+
"$");
var link = "";
for(;;) {
link = window.prompt("Evernote link?",link);
if ( link ) {
var m = link_pattern.exec(link);
if ( m ) {
var url = "https://www.evernote.com/view/notebook/"+m[1]+"?&n="+m[2];
window.location.assign(url);
break;
}
}
else {
break;
}
}
}
)();
Show in Everynote.