using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"FA-I1-I2-TR-I1-I2-FA.*(*SKIP)(*F)|(?:I\d-?)*I3(?:-?I\d)*";
string substitution = @"-";
string input = @"1-FA-I2-I2-I2-EX-I2-I3-FA-I1-I2-TR-I1-I2-FA-I3-I1-FA-FA-NR-I3-I2-TR-I1-I2-I1-I2-FA-I2-I1-I3-FA-QU-I1-I2-I2-I2-NR-I2-I2-NR-I1-I2-I1-NR-I3-QU-I2-I3-QU-NR-I2-I1-NR-QU-QU-I2-I1-EX";
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