From 7cbbd40428d82661887e7f1fd2519f860750bc39 Mon Sep 17 00:00:00 2001 From: Karan Kajla Date: Sun, 16 Apr 2023 18:23:19 -0700 Subject: [PATCH] Update the variable template/replacement regex to match any non-space characters to support all types of variable replacements (#24) --- suite.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suite.go b/suite.go index 2e06f3e..46bbefc 100644 --- a/suite.go +++ b/suite.go @@ -204,7 +204,7 @@ func (suite TestSuite) executeTest(test TestSpec, extractedFields map[string]str // Replace any template variables in test's request url with the appropriate value requestUrl := test.Request.Url - templateVariableRegex := regexp.MustCompile(`{{\s*[a-zA-Z0-9\.]+\s*}}`) + templateVariableRegex := regexp.MustCompile(`{{\s*[^\s]+\s*}}`) templateVariables := templateVariableRegex.FindAll([]byte(requestUrl), -1) for _, templateVariable := range templateVariables { templateVal := getTemplateValIfPresent(string(templateVariable), extractedFields)