new RegExp('<script[^>]*>([\\S\\s]*?)<\/script>', 'img')If you need to use $() in both Prototype.js and JQuery.js context, I have this function for you:
if (window.jQuery){ // $() compatible jQuery and Prototype true && $ // $() exists under firebug && $ === jQuery // $() === jQuery() && jQuery.noConflict(); // restaure Prototype.js!$() $_ = $; // sauve Prototype.js!$() $ = function(s){ if (typeof s !== 'string') return s; if (s.replace(/[0-9a-z\-_:\.]/gi, '').length > 0) return jQuery(s); // contient d'autres caractères que ceux admis dans un ID HTML : forcément un sélecteur CSS /* ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".") */ if (s.replace(/[a-z]/gi, '').length > 0) return $_(s); // contient des caractères non alphabétiques - forcément un id if (document.getElementsByTagName(s).length > 0) return jQuery(s); // tag return $_(s); // id avec seulement des caractères alphabétiques }; Object.extend($, jQuery); }