Galerie und tage
This commit is contained in:
22
node_modules/url-regex/index.js
generated
vendored
Normal file
22
node_modules/url-regex/index.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict';
|
||||
var ipRegex = require('ip-regex');
|
||||
|
||||
module.exports = function (opts) {
|
||||
opts = opts || {};
|
||||
|
||||
var protocol = '(?:(?:[a-z]+:)?//)';
|
||||
var auth = '(?:\\S+(?::\\S*)?@)?';
|
||||
var ip = ipRegex.v4().source;
|
||||
var host = '(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)';
|
||||
var domain = '(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*';
|
||||
var tld = '(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))';
|
||||
var port = '(?::\\d{2,5})?';
|
||||
var path = '(?:[/?#][^\\s"]*)?';
|
||||
var regex = [
|
||||
'(?:' + protocol + '|www\\.)' + auth, '(?:localhost|' + ip + '|' + host + domain + tld + ')',
|
||||
port, path
|
||||
].join('');
|
||||
|
||||
return opts.exact ? new RegExp('(?:^' + regex + '$)', 'i') :
|
||||
new RegExp(regex, 'ig');
|
||||
};
|
||||
Reference in New Issue
Block a user