using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"Worker-1] (?<JMessage>\D+\d)";
string input = @"Mar 8 14:13:05 apce14 hdsem-worker [2016-03-08 06:13:03,320: INFO/Worker-1] Sending API request (https://webapps.homedepot.com/hde/V1/lead) - params={} - payload={'type': 'json', 'inputData': '{""marketingOptIn"": 0, ""appointmentTime"": "", ""otherProductsInterest"": "", ""lName"": ""O Rivera"", ""addr2"": "", ""addr1"": ""912 SW 143rd St"", ""productCode"": ""17"", ""gradeCode"": ""KIT"", ""state"": ""FL"", ""branch"": 49, ""siebelNum"": "", ""referralCode"": ""0335"", ""appointmentWanted"": 0, ""appointmentDate"": "", ""city"": ""NEWBERRY"", ""zipCode"": ""32669"", ""storeRepID"": "", ""baseStore"": 270, ""referralStore"": "", ""fName"": ""Juan"", ""remarks"": "", ""eMail"": ""juanorivera@bellsouth.net"", ""scNumber"": "", ""wPhone"": "", ""hPhone"": ""3522146016""}'} - js";
Match m = Regex.Match(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