title: Remove substring matching pattern both in the beginning and the end of the variable
body: <p>As the title says, I'm looking for a way to remove a defined pattern both at the beginning of a variable and at the end. I know I have to use <code>#</code> and <code>%</code> but I don't know the correct syntax.</p>
  
  <p>In this case, I want to remove <code>http://</code> at the beginning, and <code>/score/</code> at the end of the variable <code>$line</code> which is read from <code>file.txt</code>.</p>