using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @".*(?<="")(?!US|CN)(?=\w{2}""|"").*";
string substitution = @"";
string input = @"[
[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""],
[529334,""US"",""Mar’ina Roshcha""],
[6255149,"",""North America""],
[1269750,""IN"",""Republic of India""],
[1283240,""NP"",""Kathmandu""],
[703363,""UA"",""Laspi""],
[3632308,""VE"",""Merida""],
[473537,""CN"",""Vinogradovo""],
[473537,""RU"",""Vinogradovo""],
[384848,""IQ"",""Qarah Gawl al ‘Ulyā""],
[569143,""RU"",""Cherkizovo""],
[713514,""UA"",""Alupka""],
[2878044,""DE"",""Lichtenrade""],
]";
RegexOptions options = RegexOptions.Multiline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx