using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"InvoiceItemID"":""(\d{6})";
string input = @"{""ClientRef"":"",""Date"":""2015-09-29 10:02:51 AM"",""InvoiceID"":""451393"",""InvoiceItemID"":""495340"",""Location"":""ARN:193602013349538<br\/>16 LEIGHLAND DR , CITY OF MARKHAM, ON, L3R 7R4"",""ReportID"":""268172,"",""Type"":""ICI Commercial \/ Industrial Report""},{""ClientRef"":"",""Date"":""2015-09-28 8:39:41 PM"",""InvoiceID"":""451035"",""InvoiceItemID"":""494939"",""Location"":""ARN:190801210003100<br\/>2250 SHEPPARD AVE W, CITY OF TORONTO, ON, M9M 1L7"",""ReportID"":""267810,"",""Type"":""Basic Report""},{""ClientRef"":"",""Date"":""2015-09-28 8:39:20 PM"",""InvoiceID"":""451034"",""InvoiceItemID"":""494938"",""Location"":""ARN:190801210003100<br\/>2250 SHEPPARD AVE W, CITY OF TORONTO, ON, M9M 1L7"",""ReportID"":""267809,"",""Type"":""ICI Commercial \/ Industrial Report""},{""ClientRef"":"",""Date"":""2015-09-28 2:59:03 PM"",""InvoiceID"":""450515"",""InvoiceItemID"":""494348"",""Location"":""ARN:240201011110900<br\/>26-34 PLAINS RD E, BURLINGTON CITY, ON, L7T 2B9"",""ReportID"":""267272,"",""Type"":""ICI Commercial \/ Industrial Report""}";
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