using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?s)Form.*?\K\d{9}(?=.*?FMLA)";
string input = @"Form ( For Medical Leaves of Absence ) DO NOT return this document with your original request for a leave of absence . Please email or fax this document to the HR Service Center 5 - 7 days before the date you're expected to return to work .
SECTION I : To be completed by Associate Associate's Name : Associate's Job Title : Associate ID ; Location / Store # James Doe Garden Associate 123456789 SECTION II : To be completed by a health care provider treating the associate / patient : Your patient is currently on leave of absence . Answer , fully and completely , all applicable parts . Several questions seek a response as to the frequency or duration of a condition , treatment , etc. Your answer should be your best estimate based upon your medical knowledge 1 , experience , and examination of the patient . Be as specific as you can ; terms such as "" lifetime , "" or "" indeterminate "" may not be sufficient to determine FMLA coverage .";
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