using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"^(.*?)\b([Vv][ao]n\s\w+|(?:[Dd][eu]\s\p{L}+|La\s\p{L}+|St\.\s\w+|Auf\sder\s\w+))(.*)";
string input = @"Emile La Sére
George A. La Dow
Gilbert De La Matyr
Robert M. La Follette
William Leroy La Follette
Robert M. La Follette Sr.
Robert M. La Follette Jr.
Charles M. La Follette
Monica De La Cruz
David A. De Armond
Justin De Witt Bowersock
De Witt C. Giddings
Julien de Lallande Poydras
Henry St. John
Edward St. Loe Livermore
Oscar L. Auf der Heide
Kika de la Garza";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
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