added regex for most forms of localhost

This commit is contained in:
Mitch Lacy 2016-07-28 14:12:21 -05:00
parent b3dec55f29
commit ccbcae0856

View file

@ -1,6 +1,6 @@
import * as regex from './url-regex';
export const domainRegex = /\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b/;
export const domainRegex = /\b((?=[a-z0-9-]{1,63}\.)(xn--)?[a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,63}\b|^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*:)*?:?0*1$/;
export default function isUrlCommand (shell, data) {
const matcher = regex[shell];