title: PHP: Regular exp to get the last number from exactly string
body: <p>I'm trying to get the string that match with original and with number in the end.</p>
  
  <p>I got these strings:</p>
  
  <pre><code>mod_courts2
  mod_courts_config
  mod_courts_config2
  </code></pre>
  
  <p>From these strings I want the one that matches only with "mod_courts" with number in the end.</p>
  
  <p>I'm doing this:</p>
  
  <pre><code>if (strpos($t, "mod_courts") !== FALSE) {
    preg_match('/^\w+(\d+)$/U', $t, $match);
    echo $match;
  }
  </code></pre>
  
  <p>This returns me <code>"mod_courts2"</code> and <code>"mod_courts_config2"</code>, I just want <code>"mod_courts2"</code></p>