title: How can I use regex to find series of data within a text file?
body: <p>I have a text file with a series as follows:</p>
  <pre><code>Lots of textLots of textLots of textLots of textLots of textLots of textLots
   of textLots of textLots of textLots of textLots of textLots of textLots of
   textLots of textLots of textLots of textLots of textLots of textLots of
   textLots of text
  
  Wave amplitude (mean, 3.0 &amp; 7.0 above LES) (mmHg)
  43-152
  35.9
  N/A
  N/A
  N/A
  43.5
  21.9
  N/A
  37.3
  N/A
  40.9
  N/A
  
      Wave duration (mean at 3.0 &amp; 7.0 above LES) (sec)
  2.7-5.4
  2.5
  N/A
  N/A
  N/A
  2.2
  3.0
  N/A
  2.2
  N/A
  2.6
  N/A
  
      Onset velocity (between 11.0 &amp; 3.0 above LES) (cm/s)
  2.8-6.3
  2.2
  N/A
  N/A
  N/A
  2.5
  1.0
  N/A
  2.5
  N/A
  2.7
  N/A
  
  Some other textSome other textSome other textSome other textSome other textSome
   other textSome other textSome other textSome other textSome other textSome 
  other textSome other textSome other textSome other textSome other textSome 
  other text
  </code></pre>
  <p>The rules are:</p>
  <ol>
  <li><p>The first line always contains a bracket somewhere and this isn't found elsewhere.</p>
  </li>
  <li><p>There is always an empty line at the end of each series of numbers(or series of N/As)</p>
  </li>
  <li><p>The values are all either numbers (with or without decimal points) or N/A.</p>
  </li>
  <li><p>I do not want to capture the first number after the title of each block (which also usually contains a - or &lt;)</p>
  </li>
  </ol>
  <p>I would like to capture the title and the subsequent numbers into one arrayList.</p>
  <p>The expected output for the first example would therefore be</p>
  <pre><code>[Wave amplitude (mean, 3.0 &amp; 7.0 above LES  (mmHg),35.9,N/A,N/A,N/A,43.5,21.9,N/A,37.3,N/A,40.9,N/A]
  </code></pre>
  <p>I am stuck on the regex that would allow me to achieve this. Because the text I want to extract lies within a bigger text file I think I need to use regex to extract just the part I'm interested in. I suppose an alternative would be to select out just the start and end of the entire section I'm interested in but it would still rely on some regex and I think the pattern to do this would be more complex.</p>