using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"3(?:\.\d+)*\.\s*";
string substitution = @"\t";
string input = @"3.1. Cre
3.1.1. Im
3.1.1.1. O
3.1.1.2. Ce
3.1.1.3. Part
3.1.2. ED
3.1.2.1. Ow
3.1.2.2. ED
3.1.3. OF
3.1.3.1. O
3.1.3.2. O
3.1.3.3. O
3.1.3.4. O
3.1.4. Sc
3.1.5. In
3.1.6. Vi
3.1.7. Bu
3.1.8. Ho
3.1.8.1. Ou
3.1.8.2. In
3.1.9. Pa
3.1.9.1. Re
3.1.9.2. Re
3.1.9.3. Pr
3.1.9.3.1. Ou
3.1.9.3.2. Sp
3.1.9.3.3. In
3.1.9.3.4. In";
Regex regex = new Regex(pattern);
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