using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"((?:(?:(?:(?:Cass\.?(?:(?:(?:(?: | | |\\1e|\\1f)*))(?:(?:fr.)|(?:aud\.(?:(?:(?: | | |\\1e|\\1f)*))pl(?:é|e|é)n\.)))?)|(?:C\.?E\.?D\.?H\.?)|(?:Cour eur\. D\.?H\.?)),?))(?:(?:(?: | | |\\1e|\\1f)*))(?:(?:(?:1<sup>er?<\/sup>|[0-9][0-9]?)(?:(?:(?: | | |\\1e|\\1f)*))(?:janvier|f(?:é|e|é)vrier|mars|avril|mai|juin|juillet|ao(?:û|u|û)t|septembre|octobre|novembre|d(?:é|e|é)cembre|januari|februari|maart|april|mei|juni|juli|augustus|sept(?:ember|\.)|oktober|nov(?:ember|\.)|dec(?:ember|\.))(?:(?:(?: | | |\\1e|\\1f)*))([1-2][0-9]{3}),?))(?:(?:(?:(?: | | |\\1e|\\1f)*))(?:[A-Z]+\.[0-9]+\.[0-9]+\.[A-Z]+\.))?(?:,?(?:(?:(?: | | |\\1e|\\1f)*))))((?:<[^>]*>)?(?:(?:(?: | | |\\1e|\\1f)*))(?:Larcier(?:(?:(?: | | |\\1e|\\1f)*))[Cc]ass(?:ation)?\.?)(?:(?:(?: | | |\\1e|\\1f)*))(?:<\s*\/[^>]*>)?(?:\.?,?(?:(?:(?: | | |\\1e|\\1f)*)))?(?:(?:(?:[nN]rs?\.?|(?:[nN](?:(?:(?: | | |\\1e|\\1f)*))<sup>o<\/sup>\.?)|[nN](?:(?:(?: | | |\\1e|\\1f)*))(?:°|˚|o)s?\.?|[Aa]fl\.))(?:(?:(?: | | |\\1e|\\1f)*)))([0-9]+))";
string input = @"C'est dingue que ceci Cass., 7 février 2001, Larcier Cass., n° 481 soit catché !";
Match m = Regex.Match(input, pattern);
Console.WriteLine("'{0}' found at index {1}", m.Value, m.Index);
}
}
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