0.1.1 • Published 6 years ago
@regexp-extra/git-url v0.1.1
RegExp for matching Git URL.
const GIT_URL = require('@regexp-extra/git-url');
// -> regular expression (global)
GIT_URL.test('https://github.com/user/');
// false
var str = 'repo: git://github.com/user/repo.git';
GIT_URL.test(str);
// true
new RegExp(GIT_URL).exec(str);
// [ 'git://github.com/user/repo.git',
// 'git://', (protocol)
// 'github.com/user/repo.git', (path)
// '', (fragment)
// index: 6,
// input: 'repo: git://github.com/user/repo.git',
// groups: undefined ]
credits: taken directly from jonschlinkert/is-git-url.