using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(^\""|\{)";
string input = @"""@odata.context"": ""https://example-app-env.aa01.aaa.aaaa-ad/odata/$metadata#Jobs"",
""@odata.count"": 111,
""value"": [
{
""Key"": ""aaa1a111-aa11-11aa-a11a-11a1aa11a111"",
""StartTime"": ""2023-01-20T14:08:34.607Z"",
""EndTime"": ""2023-01-20T14:08:49.517Z"",
""State"": ""Successful"",
""JobPriority"": ""Normal"",
""Source"": ""Agent"",
""SourceType"": ""Agent"",
""BatchExecutionKey"": ""aaa1a111-aa11-11aa-a11a-11a1aa11a111"",
""Info"": ""Job completed"",
""CreationTime"": ""2023-01-20T14:08:34.607Z"",
""StartingScheduleId"": null,
""ReleaseName"": ""RobotProdLogin_DEV"",
""Type"": ""Attended"",
""InputArguments"": "",
""OutputArguments"": ""{}"",
""HostMachineName"": ""AAAAAAAA11111"",
""HasMediaRecorded"": false,
""PersistenceId"": null,
""ResumeVersion"": null,
""StopStrategy"": null,
""RuntimeType"": ""Development"",
""RequiresUserInteraction"": true,
""ReleaseVersionId"": 1111,
""EntryPointPath"": null,
""OrganizationUnitId"": 1,
""OrganizationUnitFullyQualifiedName"": ""Default"",
""Reference"": "",
""ProcessType"": ""Process"",
""ProfilingOptions"": null,
""ResumeOnSameContext"": false,
""LocalSystemAccount"": ""AAAAAA01\\AAA11AA"",
""OrchestratorUserIdentity"": null,
""Id"": 00000
},
{
""Key"": ""aaa1a111-aa11-11aa-a11a-11a1aa11a111"",
""StartTime"": ""2023-01-20T14:08:34.607Z"",
""EndTime"": ""2023-01-20T14:08:49.517Z"",
""State"": ""Successful"",
""JobPriority"": ""Normal"",
""Source"": ""Agent"",
""SourceType"": ""Agent"",
""BatchExecutionKey"": ""aaa1a111-aa11-11aa-a11a-11a1aa11a111"",
""Info"": ""Job completed"",
""CreationTime"": ""2023-01-20T14:08:34.607Z"",
""StartingScheduleId"": null,
""ReleaseName"": ""RobotProdLogin_DEV"",
""Type"": ""Attended"",
""InputArguments"": "",
""OutputArguments"": ""{}"",
""HostMachineName"": ""AAAAAAAA11111"",
""HasMediaRecorded"": false,
""PersistenceId"": null,
""ResumeVersion"": null,
""StopStrategy"": null,
""RuntimeType"": ""Development"",
""RequiresUserInteraction"": true,
""ReleaseVersionId"": 1111,
""EntryPointPath"": null,
""OrganizationUnitId"": 1,
""OrganizationUnitFullyQualifiedName"": ""Default"",
""Reference"": "",
""ProcessType"": ""Process"",
""ProfilingOptions"": null,
""ResumeOnSameContext"": false,
""LocalSystemAccount"": ""AAAAAA01\\AAA11AA"",
""OrchestratorUserIdentity"": null,
""Id"": 00000
},";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
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