Skip to content

Instantly share code, notes, and snippets.

@szbl
Created January 2, 2013 18:07
Show Gist options
  • Save szbl/4436544 to your computer and use it in GitHub Desktop.
Save szbl/4436544 to your computer and use it in GitHub Desktop.
<?php
$string = file_get_contents( 'some-file.js' );
$pattern = '#/\*\w.+?\*/try{document.+?/\*\w.+?\*/#im';
$clean = preg_replace( $pattern, '', $string );
file_put_contents( 'some-file.js', $clean );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment