amursa
I need to substitute part of the body request with 2 json key-values pairs. I figured out the find regexp using https://regex101.com/ and it works, but I can’t find how do I add new line in substitution string. Could you pls suggest?
for example [\r\n\t\v]+”key1″: “value1”,[\r\n\t\v]+. to be replaced with “key1”: “value1”,\n “key2”: “value2”,\n.
It does not interpret \n and uses it as a string, unfortunately.
So, I need a two line substitution, like:
“key1”: “value1”,
“key2”: “value2”
I have part of my json looking like this:
“key1”:[“value 1”, “value 2”],
I find it with this regexpt THAT WORKS JUST LIKE I NEED:
^“key1”:\s?[“value\s?[0-9]+”\s?,\s?“value\s?[0-9]+[”]],\n+?
“key1”:[“value 1”, “value 2”], \n “key2”: ["test1],
In the find replace POSTMAN tab I provide in replace following string:
“key1”:[“value 1”, “value 2”], \n “key2”: ["test1],
Substitution does not interpret \n and results is in one line:
“key1”:[“value 1”, “value 2”], \n “key2”: ["test1],