using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?:(Jan(?:uary)?)|(Feb(?:ruary)?)|(Mar(?:ch)?)|(Apr(?:il)?)|(May)|(June?)|(July?)|(Aug(?:ust)?)|(Sept(?:ember)?)|(Oct(?:ober)?)|(Nov(?:ember)?)|(Dec(?:ember)?))\s+(?:(\d{2})|(\d))\s+(\d{4})";
string substitution = @"$15-${1:+01}${2:+02}${3:+03}${4:+04}${5:+05}${6:+06}${7:+07}${8:+08}${9:+09}${10:+10}${11:+11}${12:+12}-${13:+$13:0$14}";
string input = @"created: October 4 1984 22:01 test";
RegexOptions options = RegexOptions.IgnoreCase;
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