title: Java Regex: Matching Multiple Occurrences
body: <p>I have a list of phone numbers and other text such as the following:</p>
  
  <pre><code>+1-703-535-1039  +1-703-728-8382 +1-703-638-1039  +1-703-535-1039 
  </code></pre>
  
  <p>And I'm trying to match just the area code and first 3 digits of the number.</p>
  
  <p>Currently I'm using the following Regex:</p>
  
  <pre><code>\d{3}-\d{3}
  </code></pre>
  
  <p>But it only returns the first match instead of all matches.</p>
  
  <p>Pls see this link for reference:</p>
  
  <p><a href="https://regex101.com/r/oO1lI9/1" rel="nofollow">https://regex101.com/r/oO1lI9/1</a></p>