using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"facilityAlias\"":\""(?<facility>[^\""]*)";
string input = @"sample log: 2023-01-02 23:36:58,521 [[MuleRuntime].uber.3869: [abcd-message-kdhskhdsk-api].Delete_msg_from_queue.BLOCKING @27fe0275] INFO com.skdhksh.jsdhjshd.hsd.logging.internal.CustomLoggerOperations - {""environment"":""stag36rcf_eu-env"",""applicationName"":""abcd-message-kdhskhdsk-api"",""correlationId"":""kshddhks-3o4u-jshd8-aksdbkadkahd"",""apiProcessingTime"":347,""totalProcessingTime"":740,""tracePoint"":""END"",""logMessage"":""{\n \""url\"": \""abcd\"",\n \""bucketName\"": \""dipeus-data-store\"",\n \""s3versionID\"": \""shdkshdkshdkshdkshdkshdkjshd\"",\n \""s3key\"": \""ljdljdlajldj]dsdsd\ksdjksjdksjdksjdksjksjd\ksdjksjd\""\n}"",""txnMetadata"":{""bundleId"":""ahsdkhsdh-skjdhshdkshd-skdhshdks-skdhkshd"",""messageType"":""abcd"",""messageSubType"":""kdshdkshdks"",""facilityAlias"":""Parc de Salut Mar Barcelona"",""systemName"":""CMPSB"",""transactionStartTime"":1672702617781,""relatesToPatientMerge"":false,""inputPayload"":""adhkjshdkshdkshdkshd""},""apiStartTime"":""1672702618174""}";
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