using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(<)(\w+)(,\s)(.+)(,\>)";
string substitution = @"@$2 $4";
string input = @"<IccId, nvarchar(50),>
,<DeliveryNumber, nvarchar(10),>
,<DeliveryPosition, int,>
,<ItemCreationDate, smalldatetime,>
,<PlannedDeliveryDate, smalldatetime,>
,<CableLength, float,>
,<CableLengthUm, nvarchar(3),>
,<GrossWeight, float,>
,<GrossWeightUm, nvarchar(3),>
,<NetWeight, float,>
,<NetWeightUm, nvarchar(3),>
,<SalesOrganization, nvarchar(4),>
,<ShipToCode, nvarchar(10),>
,<ShipToName, nvarchar(40),>
,<ShipToStreet, nvarchar(60),>
,<ShipToHouseNumber, nvarchar(10),>
,<ShipToPostalCode, nvarchar(10),>
,<ShipToCity, nvarchar(40),>
,<ShipToCountry, nvarchar(3),>
,<ShipToRegion, nvarchar(3),>
,<DeliveryPlantNumber, nvarchar(4),>
,<CableMaterialCode, nvarchar(18),>
,<CableBatchNumber, nvarchar(10),>
,<CableNominalDiameter, float,>
,<CableNominalDiameterUm, nvarchar(3),>
,<CableName, nvarchar(40),>
,<CableProductionDate, smalldatetime,>
,<CableProductionPlant, nvarchar(4),>
,<CableSection, float,>
,<CableSectionUm, nvarchar(3),>
,<CableSectionMultiplier, float,>
,<Voltage, float,>
,<VoltageMu, nvarchar(3),>
,<DrumNumber, nvarchar(18),>
,<DrumType, nvarchar(18),>
,<DrumCoreDiameter, float,>
,<DrumCoreDiameterUm, nvarchar(3),>
,<DrumInnerWidth, float,>
,<DrumInnerWidthUm, nvarchar(3),>
,<DrumWeight, float,>
,<DrumWeightUm, nvarchar(3),>
,<CustomerPurchaseOrderNumber, nvarchar(20),>
,<CustomerName, nvarchar(35),>
,<CustomerNumber, nvarchar(10),>
,<CustomerMaterialNumber, nvarchar(35),>
,<SalesOrderNumber, nvarchar(10),>
,<SalesOrderPosition, nvarchar(6),>
,<TotalSpins, float,>
";
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