title: Get and replace the last number on a string with JavaScript or jQuery
body: <p>If I have the string:</p>
  
  <p><code>var myStr = "foo_0_bar_0";</code></p>
  
  <p>and I guess we should have a function called <code>getAndIncrementLastNumber(str)</code></p>
  
  <p>so if I do this:</p>
  
  <p><code>myStr = getAndIncrementLastNumber(str); // "foo_0_bar_1"</code></p>
  
  <p>Taking on considerations that there could be another text instead of <code>foo</code> and <code>bar</code> and there might not be <code>underscores</code>  or there might be more than one <code>underscore</code>;</p>
  
  <p>Is there any way with <code>JavaScript</code> or <code>jQuery</code> with <code>.replace()</code> and some <code>RegEx</code>?</p>