using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(\d{1,2}\.000) *\n* *(\d{1,4}\.\d{2})\n* *(\d{1,4}\.\d{2})\n* *(?:.*\n)?(\d{10}.*\n*[A-Z][A-Z])(*SKIP)(*F)|\D+|\d+";
string substitution = @"";
string input = @"A11111111 22222-33333 SVC,IPHONE 15 PRO,DISPLAY
1.000 368.00 368.00
8524910000 CN
G111111111/22222222222/33333
5
A11111111 22222-33333 SVC,STUDIO BUDS
+,RIGHT,TRANSPRENT, 1.000 96.00 96.00
8517620000 CN
G111111111/22222222222/33333
2
A11111111 22222-33333 SVC,STUDIO BUDS
+,LEFT,TRANSPRENT,C 1.000 96.00 96.00
8517620000 CN
G111111111/22222222222/33333
2
A11111111 22222-33333 SVC,IPHONE 14 1.000 855.00
855.00
PRO,ROW,128G,PRP,CI/A
8517130000 CN
G111111111/22222222222/33333
7
A11111111 22222-33333 SVC,STUDIO BUDS
+,LEFT,BLACK/GOLD,C 1.000 96.00 96.00
8517620000 CN
G111111111/22222222222/33333
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