title: ANT: Load file names and extract data from the file names
body: <p>Hello I wasn't quite sure how to title this question, but I'll explain why I'm trying to do.</p>
  
  <p>First of all, I have a folder that contains SQL scripts in a specific format, which is updateXtoY.sql, where X and Y are integers.  What I need is to know which Y is the highest number.  (basically, to know which is the latest script)</p>
  
  <p>So if I have in my folder "scripts/" 3 files:</p>
  
  <pre><code>update3to5.sql
  update2to5.sql
  update1to6.sql
  </code></pre>
  
  <p>the result I need is to have assign a property 'latest.version' the value of 6.</p>
  
  <p>From that point I can easily run the script.  So the problem I have is 3-fold:</p>
  
  <p>1- How to load the file names into a data structure.</p>
  
  <p>2- How to iterate over the data structure.</p>
  
  <p>3- How to evaluate each file name so that I can extract the "Y" part of the file and get the highest value.  (I'm reading on regex right now)</p>
  
  <p>I'm new to ANT and I'm not sure if this is possible and/or feasible.</p>
  
  <p>Thanks for any suggestions.</p>