using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"({})\1|[{]\s*?(\S*?|\S*?\(.*?\)|['][^']*?[']|[""][^""]*?[""]|[""][^""]*?[""]\.\(.*?\))(?:!(\S+?))?\s*?[}]";
string input = @"{0.concat(""8a b c d e"", 6)}
s df s sd{""one field name"".toFixed(7 , 8)} kjnkj sd asdvs ds sd{0.concat(""8a b c d e"", 6)}
ascdac{ ""one fieldname"".toFixed(7 , 8) }
ascdac{ ""onefi eldname"" }
{onefieldname.toFixed(7 , 8)}
dfgsdg { ""onefieldname"".toFixed(7 , 8)}
{onefieldname: ""toFixed(7 , 8)""}
{""onefieldname"": ""toFixed(7 , 8)""}
{ ""onefiel dname"" : ""toFixed(7 , 8)""}
{ ""onefiel dname"": 8}
{ ""onefiel dname"" : {""onefi eldname"".toFixed(7 , 8)} }
{ ""onefiel dname"" : {""onefi eldname"".toFixed(7 , 8) }}
{ ""onefiel dname"" : {onefieldname.toFixed(7 , 8)} }
{ ""onefiel dname"" : { onefieldname.toFixed(7 , 8)} }";
foreach (Match m in Regex.Matches(input, pattern))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
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