using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"(?:[a-z]{3,9}:\/\/?[\-;:&=\+\$,\w]+?[a-z0-9\.\-]+|[\/a-z0-9]+\.|[\-;:&=\+\$,\w]+@)[a-z0-9\.\-]+(?:(?:\/[\+~%\/\.\w\-_]*)?\??[\-\+=&;%@\.\w_]*#?[\.\!\/\\\w]*)?";
string substitution = @"(url)$U";
string input = @"[PT]Consultório de dentista equipado e pronto //sssss.ssss.sss a funcionar.<br />Com la/boratório, sala de espera, escritório e wc.<br />Alarme instalado. Sistema de som interligado para todas as divisões.<br />Prédio com porteiro.<br />2 minutos (a pé) da estação de metro da Trindade.<br /><br />Fotos 360º:<br /><br />Consultório + Laboratório<br />https://photosynth.net/view.aspx?cid=f0e5b9db-fdec-4e50-9a83-69d7c2bc44e7<br /><br />Escritório<br />https://photosynth.net/view.aspx?cid=da4c64fe-c4cf-45f5-8bf9-ff62d369e98a<br /><br />Sala de espera<br />https://photosynth.net/view.aspx?cid=b631fd55-f7e7-41b3-a9a2-2f687dffeec8[/PT][EN]Consultório + Laboratório<br />http://photosynth.net/view.aspx?cid=f0e5b9db-fdec-4e50-9a83-69d7c2bc44e7[/EN][FR]Consultório + Laboratório<br />www.photosynth.net/view.aspx?cid=f0e5b9db-fdec-4e50-9a83-69d7c2bc44e7[/FR]";
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