using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"url\('[\.]{2}\/";
string substitution = @"url(//en.wikipedia.org/${1})";
string input = @"@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.1.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.1.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff?v=4.1.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.1.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal} .preview .fa{display:inline-block;font-family:FontAwesome;font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale} .preview .fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%} .preview .fa-2x{font-size:2em} .preview .fa-3x{font-size:3em} .preview .fa-4x{font-size:4em} .preview .fa-5x{font-size:5em} .preview .fa-fw{width:1.28571429em;text-align:center} .preview .fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none} .preview .fa-ul>li{position:relative";
Regex regex = new Regex(pattern);
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