title: Create a pattern to replace all script sources
body: <p>How can I create a pattern that replaces all the scripts sources in a php document with another string?</p>
  
  <p>For example we have the <code>$haystack = '&lt;script src="oldscript.js"&gt;&lt;/script&gt;';</code></p>
  
  <p>And we should do it like this <code>$haystack = preg_replace('/src="[a-zA-Z0-9]{1,250}"/', 'myscript.js', $haystack);</code></p>
  
  <p>But this does not work. I am doing something wrong ? Or is there another way to do this?</p>