title: Extract phone numbers from string using regex?
body: <p>I need to extract some phone numbers from large strings in rails. These numbers will come in a variety of formats and could have multiple phone numbers in a single string.</p>
  
  <p>Here is an example of the types of formats that occur:</p>
  
  <ul>
  <li>022 1234567</li>
  <li>021 123 2345</li>
  <li>0271233211</li>
  <li>021-233-9123</li>
  <li>09 123 32112</li>
  <li>021 2331231 or 021 321123123</li>
  </ul>
  
  <p>What is the most efficient way to extract phone numbers like this that appear within a body of text?</p>
  
  <p>UPDATE:
  Thanks for the answers. After testing some of them I realise that I should include more examples. Here are some more that don't appear in the list above:</p>
  
  <ul>
  <li>622 32281</li>
  <li>5754321</li>
  <li>092213212</li>
  <li>(09)1234321</li>
  </ul>