title: Formatting a string to a certain format
body: <p>I'm looking a way to reformat a phone number for display in Javascript. Here's an example of some of the data:</p>
  
  <p>00-22 345 991</p>
  
  <p>555922134</p>
  
  <p>12450-123948</p>
  
  <p>I want to reformat the number to the following 3 length format like: <code>555-922-134</code></p>
  
  <p>Assuming that dashes and spaces can be ignored and the last two blocks can be a length of 2 like: <code>002-234-59-91</code> or <code>124-501-349-48</code></p>