using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"""([^""]+)"":";
string input = @"{
""activity:status"": ""BOOKED"",
""criteria:duration"": 8,
""criteria:tripFrom"": 1500242400,
""criteria:tripTo"": 1500933600,
""intent:booker"": 0.06258322237017303,
""intent:churnRisk"": 0.3004193725304727,
""intent:churnRiskText"": ""LOW"",
""intent:userClass"": ""CUSTOMER"",
""issues:acs"": 14,
""issues:total"": 0,
""revenue"": 2896,
""tracking:events"": 162,
""tracking:firstVisit"": 1475320136,
""tracking:lastVisit"": 1498054362,
""tracking:sessions30"": 19,
""tracking:timeSpent"": 10603,
""value:potentialRevenue"": {
""mean"": 2880.5258186397987,
""stddev"": 504.1184773012633,
""weight"": 1,
""confidence"": 1
},
""criteria:occupancy"": {
""adults"": 2,
""children"": 2,
""infants"": 0
}
}";
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