Example code:
var gdjfgjfgj235f = 1; var d=document;var s=d.createElement('script'); s.type='text/javascript';
(...)
d.getElementsByTagName('head')[0].appendChild(s);
}
Sed:
sed -i ‘/^var gdjfgjfgj235f/,/^}/d’ $file
sed -i ‘/^d.getElementsByTagName(.*head.*appendChild/,/^}/d’ $file