using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"Employee Table:(?:(?:\n(?!$))[^\n<]*)*";
string input = @"Employee Table:
Name Description Type
Bob Employee Standard
Jim Employee Standard
james Employee Standard
Tools:
Item Serial Tag
Battery 0101 B.
Drill 9292 D.
Phone 8464 P.
Locations:
Station code len
West 12 9
North 1 9
East 21 9
Employee Table:
Name Description Type
Bob Employee Standard
Jim Employee Standard
james Employee Standard
Tools:
Item Serial Tag
Battery 0101 B.
Drill 9292 D.
Phone 8464 P.
Locations:
Station code len
West 12 9
North 1 9
East 21 9
";
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