文件內容如下
[
[707860,"UA","Hurzuf"],
[519188,"RU","Novinki"],
[1283378,"NP","Gorkhā"],
[1270260,"IN","State of Haryāna"],
[708546,"UA","Holubynka"],
[1283710,"NP","Bāgmatī Zone"],
[529334,"RU","Mar’ina Roshcha"],
[1269750,"IN","Republic of India"],
[1283240,"NP","Kathmandu"],
[703363,"UA","Laspi"],
[3632308,"VE","Merida"],
[473537,"RU","Vinogradovo"],
[384848,"IQ","Qarah Gawl al ‘Ulyā"],
[569143,"RU","Cherkizovo"],
[713514,"UA","Alupka"],
[2878044,"DE","Lichtenrade"],
...
這是一個包含 城市id、國家、城市名稱 的 json 檔
因為我現在只想要某些特定國家的城市就好
要把不用的部分都刪掉
假設我想留下的是 US & CN
我使用 notepad++ 的搜尋取代功能 - 規則運算式
搜尋:
.+"(?<!US|CN)",.+\n
取代:
但這只會找出國家欄位是空白的行
如 [6255149,"","North America"],
無法找出國家非 US or CN 的行
請問我應該怎麼下條件呢?
感謝!!