$re = '/(skip-if-active=")([^"]+)(")/m';
$str = '<script skip-if-active="facebook-for-woocommerce/facebook-for-woocomerce.php">
!(function (f, b, e, v, n, t, s) {
if (f.fbq) return;
n = f.fbq = function () {
n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);
};
if (!f._fbq) f._fbq = n;
n.push = n;
n.loaded = !0;
n.version = "2.0";
n.queue = [];
t = b.createElement(e);
t.async = !0;
t.src = v;
s = b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t, s);
})(window, document, "script", "https://connect.facebook.net/de_DE/fbevents.js");
fbq("init", "{{fbPixelId}}");
fbq("track", "PageView");
</script>
<noscript><img height="1" width="1" alt="" style="display: none;" src="https://www.facebook.com/tr?id={{fbPixelId}}&ev=PageView&noscript=1" /></noscript>';
$subst = "";
$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