using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"([[:space:]]+|^)areaIntegrate\(down\) of grad\(T\)y[[:space:]]+";
string input = @"
Time = 0
Reading fields:
volScalarField: grad(T)y
Executing functionObjects
surfaceFieldValue patchIntegrate(name=down,grad(T)y) write:
total faces = 4000
total area = 5.286456431623655e-06
areaIntegrate(down) of grad(T)y = -0.3799414476287353
Space-averaged Nusselt lambda = 5.34607670341618
Time = 0.45
Reading fields:
volScalarField: grad(T)y
Executing functionObjects
surfaceFieldValue patchIntegrate(name=down,grad(T)y) write:
areaIntegrate(down) of grad(T)y = -0.6680860499604798
Space-averaged Nusselt lambda = 5.34607670341618";
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