using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(Accumulated Earnings Tax\.).+?\n(.*\.)";
string input = @"Accumulated Earnings Tax.
A tax penalty which is imposed on corporate earnings which are retained by the corporation for non-business related needs.
Acquisition Cost.
The expenses incurred by an insurer or reinsurance company that are directly related to putting the business on the books of the company. The largest portion of this cost is usually the agent's or sales representative's commission or bonus.
Act of God.
An event arising out of natural causes with no human intervention which could not have been prevented by reasonable care or foresight. Examples are floods, lightning, and earthquakes.
Actual Cash Value.
An amount equivalent to the replacement cost of lost or damaged property at the time of the loss, less depreciation. With regard to buildings, there is a tendency for the actual cash value to closely parallel the market value of the property. See also Market Value. ";
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