title: How to retrieve certain file elements using groovy and store elements as arraylist
body: <p>I’m new to groovy programming and I am trying to use groovy to retrieve phone numbers that are randomly present in a text file and then store these values in an arraylist in my groovy program.  An example of what the text file looks like is this:</p>
  
  <p>Line of code 
  Hello how are you 111-111-1111
  Cat dog dog cat
  999-999-9999
  Another line of code  777-777-7777</p>
  
  <p>The output I’m trying to display:
  111-111-1111
  999-999-9999
  777-777-7777</p>
  
  <p>I know how to reference the file and retrieve all lines of code and specific numbers/words/etc., but I am unsure of the groovy way to retrieve just the phone numbers present in the text file</p>