$re = '/url\(\'[\.]{2}\//';
$str = '@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';
$subst = "url(//en.wikipedia.org/${1})";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
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 PHP, please visit: http://php.net/manual/en/ref.pcre.php