1

HOCON playground: https://hocon-playground.herokuapp.com/

Here's what I am trying to achieve:

I need end result to be:

{ "HOCON" : "{host =~ "hi*"}", "lbid" : "hi*" }

What I am getting is:

Input:

lbid="hi*" HOCON = "{host =~ \""${lbid}"\"}"

Output: { "HOCON" : "{host =~ \"hi*\"}", "lbid" : "hi*" }

Can someone tell me how to escape double quotes in presence of multiple double quotes? I need the entire string inside double quotes like ("hi*").

hi value is also coming from a variable. This is making things little bit complicated and not providing the expected output.

Akshay M
  • 39
  • 1
  • 8
  • The "end result" requested is not valid JSON. You can't have unescaped double quotes within a JSON string. The escaped double quotes get turned into plain double quotes when the JSON string value is parsed by a JSON parser. – Tony Jun 30 '22 at 22:30

0 Answers0