Reputation: 396
I have a JSON file, where I would like to remove the comma at the end of each line with the key FullName
using Notepad++. I read about regular expressions and checked many forum questions without success.
{
"Symbol": "BTC",
"CoinName": "Bitcoin",
"FullName": "Bitcoin (BTC)",
},
{
"Symbol": "LTC",
"CoinName": "Litecoin",
"FullName": "Litecoin (LTC)",
},
{
"Symbol": "XMR",
"CoinName": "Monero",
"FullName": "Monero (XMR)",
}
Upvotes: 0
Views: 212
Reputation: 48711
Translating that requirement into a regex isn't that hard. Just follow what you say:
^(\s*"FullName".*),
and replace it with $1
(back-reference to first capturing group) or you can search for:
^\s*"FullName".*\K,
and replace it with nothing.
^
means assert start of line\s*
any following space characters.*
anything up to end of line\K
reset matchUpvotes: 2