using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"user_search\""=>{\""name\""=>(?<result>.*)";
string input = @"I, [2021-09-23T00:46:31.172197 #44154] INFO -- : [651235bf-7ad5-4a2e-a3b8-7737a3af9fc3] Parameters: {""user_search""=>{""name""=>""aniket"", ""has_primary_phone""=>""false"", ""query_params""=>{""searchString""=>"", ""start""=>""0"", ""filters""=>[""]}}}
host = qa-1132-lx02source = /src/project.logsourcetype = data:log
I, [2021-09-23T00:48:31.162197 #44154] INFO -- : [651235bf-7ad5-4a2e-a3b8-7737a3af9fc3] Parameters: {""user_search""=>{""name""=>""shivam"", ""has_primary_phone""=>""false"", ""query_params""=>{""searchString""=>"", ""start""=>""0"", ""filters""=>[""]}}}
host = qa-1132-lx02source = /src/project.logsourcetype = data:log
I, [2021-09-23T00:52:27.171197 #44154] INFO -- : [651235bf-7ad5-4a2e-a3b8-7737a3af9fc3] Parameters: {""user_search""=>{""name""=>""tiwari"", ""has_primary_phone""=>""false"", ""query_params""=>{""searchString""=>"", ""start""=>""0"", ""filters""=>[""]}}}
host = qa-1132-lx02source = /src/project.logsourcetype = data:log";
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