UNPKG

org-regex

Version:

Regular expression for matching npm organization names

12 lines (7 loc) 199 B
'use strict'; const regex = '@[a-z\\d][\\w-.]+/?'; const orgRegex = options => options && options.exact ? new RegExp(`^${regex}$`, 'i') : new RegExp(regex, 'gi'); module.exports = orgRegex;