From 03d4b61208dec3d4800add4a8da915f467c71e11 Mon Sep 17 00:00:00 2001 From: sridhar-komati <32507423+sridhar-komati@users.noreply.github.com> Date: Wed, 13 Mar 2019 20:42:19 +0530 Subject: [PATCH] used regex instead of string replacing --- public/app/features/templating/custom_variable.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/features/templating/custom_variable.ts b/public/app/features/templating/custom_variable.ts index c98048f04ca..f983c4b367b 100644 --- a/public/app/features/templating/custom_variable.ts +++ b/public/app/features/templating/custom_variable.ts @@ -40,7 +40,7 @@ export class CustomVariable implements Variable { updateOptions() { // extract options in comma separated string (use backslash to escape wanted commas) this.options = _.map(this.query.match(/(?:\\,|[^,])+/g), text => { - text = text.replace('\\,', ','); + text = text.replace(/\\,/g, ','); return { text: text.trim(), value: text.trim() }; });