RegExp missing some chars, e.g., % if URL-encoded. We tend to use 10\.(?:\d{4})/(?:[^ "'<&]+) but that can break too - it's annoying that the DOI spec doesn't limit the chars allowed! This is for searching the whole text (incl. within href), not element-wise so might not suit your code exactly.
- Fergus Gallagher
Fergus: going to take a look and give that a try, probably only will try to work with displayed text, but it might be cool to add compatibility with any kind of field attribute or xhtml. thanks!
- Mike Chelen
One special case worth looking for is "COiNS" OpenURL. Our (jQuery) code is var z = jQuery(".Z3988:eq(0)"); if (z.length) { var r = z.attr("title").split("&"); for (var i=0; i<r.length; i++) { var x = decodeURIComponent(r[i]); if (/^rft_id=info:doi\/.*?(10\.\d\d\d\d\/.*)/.exec(x)) { var doi = RegExp.$1; doSomething(doi); return; } } }
- Fergus Gallagher