<?xml version="1.0" encoding="utf-8"?><t:transform version="1.0" xmlns:t="http://www.w3.org/1999/XSL/Transform" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:e="urn:extension" exclude-result-prefixes="ms e"><ms:script language="JScript" implements-prefix="e"><![CDATA[

  var URLchar = '!#$%-\\/:;=?@\\[\\\\\\]_~';
  var URLend  = '!#$%-+\\-\\/=?@\\[\\\\\\]_~0-9a-z';
  var Space   = '\\u0009-\\u000D\\u0020\\u00A0\\u2000-\\u200A';

  function newRE(s) { return new RegExp(s.replace(/\[e\]/g,'['+URLend+']')
                                         .replace(/\[u\]/g,'['+URLchar+']')
                                         .replace(/\[U\]/g,'['+URLchar+'0-9a-z]')
                                         .replace(/\[s\]/g,'['+Space+']'),'i'); }

  var ANYurl = '([a-z]+:\\/\\/[U]+[e])';
  var DOInum = '10\\.[U]+\\/[U]+[e]';
  var DOIurl = 'https?:\\/\\/(?:|[U]*?[u])doi\\.org\\/('+DOInum+')';
  var DOIstr = '(?:^|\\W)((?:doi[s]+)?('+DOInum+'))';

  var containsANYurl_re = newRE(ANYurl);
  var isANYurl_re       = newRE('^'+ANYurl+'$');
  var containsDOIurl_re = newRE(DOIurl);
  var isDOIurl_re       = newRE('^'+DOIurl+'$');
  var containsDOIstr_re = newRE(DOIstr);
  var isDOIstr_re       = newRE('^'+DOIstr+'$');
  var isDOInum_re       = newRE('^'+DOInum+'$');

  function containsURL(s) { return containsANYurl_re.test(s); }
  function isURL(s) { return isANYurl_re.test(s); }
  function findURL(s) { if (containsANYurl_re.test(s)) return RegExp.$1; return ''; }

  function containsDOI(s) { return containsDOIurl_re.test(s); }
  function isDOI(s) { return isDOIurl_re.test(s); }
  function findDOI(s) { if (containsDOIurl_re.test(s)) return RegExp.$1; return ''; }

  function containsDOIstr(s) { return containsDOIstr_re.test(s); }
  function isDOIstr(s) { return isDOIstr_re.test(s); }
  function isDOInum(s) { return isDOInum_re.test(s); }
  function findDOIstr(s) { if (containsDOIstr_re.test(s)) return RegExp.$1; return ''; }
  function findDOInum(s) { if (containsDOIstr_re.test(s)) return RegExp.$2; return ''; }

  function findURLprefix(s) { if (/^([a-z]+:\/\/)/i.test(s)) return RegExp.$1; return ''; }

]]></ms:script></t:transform>