using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^\d{4}\s+\d{2}([A-Z ]*?[A-Z])\s*\d.*";
string substitution = @"$1";
string input = @"0010 00LTT BOX PCS RH039349 0101113140 DE1 D 1
1210 02EXH BX PCS RH 060644 010111 DL5 D 1
0010 00PLATE BENT 039348 0101116201 DE1 B 1
0010 00PLATE BENT RH 039348 0101116201 DE1 C 1
0010 00ANGLE 038310 0101110200 DD1 B 1";
RegexOptions options = RegexOptions.Multiline;
Regex regex = new Regex(pattern, options);
string result = regex.Replace(input, substitution);
}
}
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