using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(,\d{3}$)";
string substitution = @"$1\n<font color=#FFFF00>";
string input = @"1
00:00:06,000 --> 00:00:12,074
- = www.OpenSubtitles.org = -
2
00:01:35,623 --> 00:01:38,208
Apollo Três aqui.
Houston, você pode me copiar?
3
00:01:39,168 --> 00:01:41,378
Apollo Três, aqui é Houston.
Voce me ouve
4
00:01:41,503 --> 00:01:43,797
Bem recebido, de Houston.
Apollo Três aqui.
5
00:01:44,340 --> 00:01:48,385
Apollo Três, está tudo bem aqui.
6
00:01:49,428 --> 00:01:52,973
- Lee, você pode me copiar?
- Você é recebido, Capcom. Que falador.";
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