// (#<identifier> rule)
// re = captureNames( /^(#<protocol> [^:]*:)\/\/(?:(#<user> [-+\w.]+)(?::(#<password> [-+\w.]+))@)?(#<hostname> (#<host> [^:\\/?#]+)(?::(#<port> \d+))?)(#<path> [/\\][^?#]*)?(#<search> \?[^#]*)?(#<hash> #.*)?$/ );
// console.log( re.group(location.href) );
function captureNames(re) {
var names = [];
re = new RegExp( re.source.replace( /#<(\w{1,32})> /g, function(q, e) {
names.push(e);
return '';
} ), (re.global ? 'g' : '') + (re.ignoreCase ? 'i' : '') + (re.multiline ? 'm' : '') );
re.names = names;
function assign(m) {
if (m == null) {
return m;
}
var i = re.names.length, j, o = {};
while (i) {
j = i;
o[ re.names[--i] ] = m[j];
}
return o;
}
re.group = function(str) {
return assign( re.exec(str) );
}
return re;
}