title: Twig / PHP - Format string using Replace or Regex
body: <p>How can I format a string in Twig as follows:</p>
  
  <p>For example: <code>img = 05myphoto-Car.jpg</code> </p>
  
  <p>I need to remove the numeric prefix and <code>-</code> <br>
  I am mainly using this to output captions for images based on their filename</p>
  
  <p>Desired Output:</p>
  
  <pre><code>Myphoto Car
  </code></pre>
  
  <p>I have tried this so far, from the docs:</p>
  
  <pre><code>{{ img |replace({'.jpg': "", '-' : " "}) }}
  </code></pre>
  
  <p>Outputs String</p>
  
  <pre><code>05myphoto Car
  </code></pre>
  
  <p>I also tried  <code>{{ replace({'range(0, 9)': ""}) }} // for numeric prefix - did not work</code></p>