I'm attempting to use sed to remove some lines from json files. As you can probably tell, I'm very much an amateur but think I have the regex correct. However sed throws various errors including unterminated address and unterminated 's' command.
The text I'm trying to remove is:
{
"trait_type": "Accessories",
"value": "None"
}
And the regex I have to remove this (trait_type is different throughout different files and so I need to remove this entire block based on the value being "none")
(\{)([\r\n].+)(\r|\n|)(.*(?:None).*)([\r\n].*)
Using online regex testers, the above seems to work perfectly.
The command (and a couple of variations of) that I'm using is:
sed -e 's/\{([\r\n].+)(\r|\n|)(.*(?:None).*)([\r\n].*)//g' 2.json
Could anyone assist at all?
Many thanks