using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?# Patrón de nombre multivariado)
\bJorge\s+((Alberto|A\.?)\s+)?/?(?P<Apellido>G[óo]mez)(\s+(Prada|P\.?))?\b";
string substitution = @"Amparo \g<Apellido>";
string input = @"(1)Jorge Alberto Gómez Prada = (2)Jorge Gómez = (3)Jorge A Gómez = (4)Jorge A. Gómez P.
(5)(Jorge GOMEZ P.a) ... (6)Alberto jorge GÓMEZ (7)Jorge /Gómez
(8)>>Jorge A
Gómez P<< (9)Jorge Gómez Pradas (10)JJorge Gómez (11) Luis Jorge Gómeza";
RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.IgnorePatternWhitespace;
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