From 79e778af7ad64c840a5c4ea3946e012d8bbc6b03 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Wed, 24 May 2017 08:51:28 -0400 Subject: [PATCH] make comment explanatory of new style Thanks @rschamp! --- bin/lib/fastly-config-methods.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/lib/fastly-config-methods.js b/bin/lib/fastly-config-methods.js index 3a3d7581c..d84756262 100644 --- a/bin/lib/fastly-config-methods.js +++ b/bin/lib/fastly-config-methods.js @@ -33,8 +33,10 @@ var FastlyConfigMethods = { }, /* - * Translate an express-style pattern e.g. /path/:arg/ to a regex - * all :arguments become .+? + * Translate an express-style pattern to regex one in two ways: + * + * 1. /path/:arg/ – all :arg's become .+? + * 2. /path/:arg([regex]) – :arg is removed, leaving just /path/([regex]) */ expressPatternToRegex: function (pattern) { pattern = pattern.replace(/(:\w+)(\([^\)]+\))/gi, '$2');