From 5915e847cc11430422545a1972611c1f65352d54 Mon Sep 17 00:00:00 2001 From: Tiffany Kyi Date: Fri, 21 Jul 2017 11:21:30 -0700 Subject: [PATCH] fix(616): Fix template and version regexes --- config/regex.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/regex.js b/config/regex.js index dd6d1695..2574f7af 100644 --- a/config/regex.js +++ b/config/regex.js @@ -11,13 +11,13 @@ module.exports = { TEMPLATE_TAG_NAME: /^[a-zA-Z][\w-]+$/, // Version can only have up to 2 decimals, like 1.2.3 // It can also be just major or major and minor versions, like 1 or 1.2 - VERSION: /^(\d+)+(\.\d+)?(\.\d+)?$/, + VERSION: /^(\d+)(\.\d+)?(\.\d+)?$/, // Exact version should contain the major, minor, and patch versions, e.g. 1.2.3 - EXACT_VERSION: /^(\d+)+(\.\d+)+(\.\d+)+$/, + EXACT_VERSION: /^(\d+)\.(\d+)\.(\d+)$/, // Full name of template and version. Can be @ or @ // Example: chef/publish@1.2.3 or chef/publish@stable // Only or @ is also acceptable - FULL_TEMPLATE_NAME: /^([\w/-]+)(@(((\d+)+(\.\d+)?(\.\d+)?)|([a-zA-Z][\w-]+))?)?$/, + FULL_TEMPLATE_NAME: /^([\w/-]+)(?:@((?:(?:\d+)(?:\.\d+)?(?:\.\d+)?)|(?:[a-zA-Z][\w-]+)))?$/, // Steps can only be named with A-Z,a-z,0-9,-,_ STEP_NAME: /^[\w-]+$/, // Jobs can only be named with A-Z,a-z,0-9,-,_