using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"0\R+(.+)\R(?:(?!CDN)(?!^0$)[\s\S])+(?:\RCDN\$\h+(\d+\.\d+))?(?:\RCDN\$\h+(\d+\.\d+))?\R(?:(?!^0$)[\s\S])+";
string substitution = @"$1 $2 $3\n";
string input = @"
0
South Park™: The Stick of Truth™
OVERALL REVIEWS:
OVERWHELMINGLY POSITIVE
RELEASE DATE:
3 MAR, 2014
-75%
CDN$ 39.99
CDN$ 9.99
Add to Cart
RPGComedyAdventureFunnyTurn-Based
Added on 8/9/2020 ( remove )
0
Grand Theft Auto V
OVERALL REVIEWS:
VERY POSITIVE
RELEASE DATE:
13 APR, 2015
View Details
Open WorldActionMultiplayerAutomobile SimCrime
Added on 1/15/2020 ( remove )
0
System Shock
OVERALL REVIEWS:
NO USER REVIEWS
RELEASE DATE:
SUMMER 2021
CDN$ 51.49
Add to Cart
ActionAdventureCyberpunkSci-fiImmersive Sim
Added on 6/9/2020 ( remove )
";
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