# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/url\([\.]{2}\\/(\w+(([\\/]\w+)*(-\w+|\.\w+))*)/url(\/\/en.wikipedia.org\/${1})/g;t' <<< "d: url(../images/printer.gif) top left no-repeat; {
.preview .mw-wiki-logo {
background-image: url(/static/images/project-logos/enwiki-1.5x.png); background-size: 135px auto background-image: url(/static/images/project-logos/enwiki-2x.png);
.preview li.mw-changeslist-line-watched, .preview li.mw-history-line-updated {
list-style-image: url(//upload.wikimedia.org/wikipedia/commons/1/19/ChangedBulletVector.svg);
list-style-image: url(//upload.wikimedia.org/wikipedia/commons/c/c2/ChangedBulletVector.png) \9
}
}
}
@media (-webkit-min-device-pixel-ratio: 2),(min--moz-device-pixel-ratio: 2),(min-resolution: 2dppx),(min-resolution: 192dpi) {
.preview .mw-wiki-logo {
background-image: url(/static/images/project-logos/enwiki-2x.png);
background-size: 135px auto
}
}"
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 SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html