using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"U\d*_([A-Za-z0-9\_]+)(?:\s*\d\s*\d*\s*\d*\s*\d*\s*\d*\s*\d*\s*\d*\s*(\d*)\s*\d*\s*\d*\s*\d*\s*(\d*)\s*\d*\s*\d*\s*(\d*))";
string input = @"U2_BOMBEROS_MERIDA4 1 734 4 0 0 0 0 54524 1 1 1 55302 0 0 54524 0 1 1 0 0 OFF 12 412 43 0 OFF OFF 0 0 1 1 1 10 10 10 10 0 0 OFF 3 0 0 0 OFF 90 180 0 OFF 0 0 0 OFF OFF OFF 90 180 0 OFF 0 0 OFF OFF OFF OFF OFF OFF ON 0 0 0 0 OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 OFF 0 OFF OFF
U2_SAN_JAVIER_DEL_VALLE5 1 734 4 0 0 0 0 53955 1 1 1 55303 0 0 53955 0 1 1 0 0 OFF 12 412 43 0 OFF OFF 0 0 1 1 1 10 10 10 10 0 0 OFF 3 0 0 0 OFF 90 180 0 OFF 0 0 0 OFF OFF OFF 90 180 0 OFF 0 0 OFF OFF OFF OFF OFF OFF ON 0 0 0 0 OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 OFF 0 OFF OFF
";
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