using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @".+left X:..(.+?)\n.+Y:..(.+?)\n.+\n.+\n.+:.(.+?)\n.+:.(.+?)\n";
string input = @"
xwininfo: Window id: 0x4800024 ""Yebe""
Absolute upper-left X: 100
Absolute upper-left Y: 164
Relative upper-left X: 10
Relative upper-left Y: 45
Width: 1600
Height: 1200
Depth: 24
Visual: 0x6e
Visual Class: DirectColor
Border width: 0
Class: InputOutput
Colormap: 0x4800022 (not installed)
Bit Gravity State: ForgetGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +100+164 -860+164 -860-76 +100-76
-geometry 1600x1200+90-66";
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