For robotframework Replace String Using Regexp, I need to write a regex but I'm newbie can you help me ?
Need to transform in a String each occurs
like {{string1.string2.string3.string4}}
to ${string1_string2_string3_string4}
So the transformations are :
{{ will be ${
}} will be }
. will be _
For example I got a string (or a file..) that contain ;
{
"my.value_1{}":{{string1.string2.string3.string4}},
"my_value2.}{":{{string1.string2.string3.string4}},
"my_value3":{{string1.string2}}10.64
}
I want it to be :
{
"my.value_1{}":${string1_string2_string3_string4},
"my_value2.}{":${string1_string2_string3_string4},
"my_value3":${string1_string2}10.64
}
As you can see, only occurs that in format {{string1.string2.string3.string4}}
or {{string1.string2}}... must to be transformed by the regex. Chars like { } . must not be transformed if not like format that I said.
Thanks a lot!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…