title: Parsing a text file using java with multiple values per line to be extracted
body: <p>I'm not going to lie I'm really bad at making regular expressions. I'm currently trying to parse a text file that is giving me a lot of issues. The goal is to extract the data between their respective "tags/titles". The file in question is a .qbo file laid out as follows <em>personal information replaced with "DATA"</em>: The parts that I care about retrieving are between the "STMTTRM" and "/STMTTRM" tags as the rest I don't plan on putting in my database, but I figured it would help others see the file content I'm working with. I apologize for any confusion prior to this update.</p>
  
  <pre><code>FXHEADER:100
  DATA:OFXSGML
  VERSION:102
  SECURITY:NONE
  ENCODING:USASCII
  CHARSET:1252
  COMPRESSION:NONE
  OLDFILEUID:NONE
  NEWFILEUID:NONE
  
  &lt;OFX&gt;
  &lt;SIGNONMSGSRSV1&gt;&lt;SONRS&gt;
      &lt;STATUS&gt;&lt;CODE&gt;0&lt;/CODE&gt;&lt;SEVERITY&gt;INFO&lt;/SEVERITY&gt;&lt;/STATUS&gt;
      &lt;DTSERVER&gt;20190917133617.000[-4:EDT]&lt;/DTSERVER&gt;
      &lt;LANGUAGE&gt;ENG&lt;/LANGUAGE&gt;
      &lt;FI&gt;
          &lt;ORG&gt;DATA&lt;/ORG&gt;
          &lt;FID&gt;DATA&lt;/FID&gt;
      &lt;/FI&gt;
      &lt;INTU.BID&gt;DATA&lt;/INTU.BID&gt;
      &lt;INTU.USERID&gt;DATA&lt;/INTU.USERID&gt;
  &lt;/SONRS&gt;&lt;/SIGNONMSGSRSV1&gt;
  &lt;BANKMSGSRSV1&gt;
  &lt;STMTTRNRS&gt;
      &lt;TRNUID&gt;0&lt;/TRNUID&gt;
      &lt;STATUS&gt;&lt;CODE&gt;0&lt;/CODE&gt;&lt;SEVERITY&gt;INFO&lt;/SEVERITY&gt;&lt;/STATUS&gt;
      &lt;STMTRS&gt;
          &lt;CURDEF&gt;USD&lt;/CURDEF&gt;
          &lt;BANKACCTFROM&gt;
              &lt;BANKID&gt;DATA&lt;/BANKID&gt;
              &lt;ACCTID&gt;DATA&lt;/ACCTID&gt;
              &lt;ACCTTYPE&gt;CHECKING&lt;/ACCTTYPE&gt;
              &lt;NICKNAME&gt;FREEDOM CHECKING&lt;/NICKNAME&gt;
          &lt;/BANKACCTFROM&gt;
          &lt;BANKTRANLIST&gt;
              &lt;DTSTART&gt;20190717&lt;/DTSTART&gt;&lt;DTEND&gt;20190917&lt;/DTEND&gt;
              &lt;STMTTRN&gt;&lt;TRNTYPE&gt;POS&lt;/TRNTYPE&gt;&lt;DTPOSTED&gt;20190717071500&lt;/DTPOSTED&gt;&lt;TRNAMT&gt;-5.81&lt;/TRNAMT&gt;&lt;FITID&gt;3893120190717WO&lt;/FITID&gt;&lt;NAME&gt;DATA&lt;/NAME&gt;&lt;MEMO&gt;POS Withdrawal&lt;/MEMO&gt;&lt;/STMTTRN&gt;
              &lt;STMTTRN&gt;&lt;TRNTYPE&gt;DIRECTDEBIT&lt;/TRNTYPE&gt;&lt;DTPOSTED&gt;20190717085000&lt;/DTPOSTED&gt;&lt;TRNAMT&gt;-728.11&lt;/TRNAMT&gt;&lt;FITID&gt;4649920190717WE&lt;/FITID&gt;&lt;NAME&gt;CHASE CREDIT CRD&lt;/NAME&gt;&lt;MEMO&gt;DATA&lt;/MEMO&gt;&lt;/STMTTRN&gt;
              &lt;STMTTRN&gt;&lt;TRNTYPE&gt;ATM&lt;/TRNTYPE&gt;&lt;DTPOSTED&gt;20190717160900&lt;/DTPOSTED&gt;&lt;TRNAMT&gt;-201.99&lt;/TRNAMT&gt;&lt;FITID&gt;6674020190717WA&lt;/FITID&gt;&lt;NAME&gt;DATA&lt;/NAME&gt;&lt;MEMO&gt;ATM Withdrawal&lt;/MEMO&gt;&lt;/STMTTRN&gt;
          &lt;/BANKTRANLIST&gt;
          &lt;LEDGERBAL&gt;&lt;BALAMT&gt;2024.16&lt;/BALAMT&gt;&lt;DTASOF&gt;20190917133617.000[-4:EDT]&lt;/DTASOF&gt;&lt;/LEDGERBAL&gt;
          &lt;AVAILBAL&gt;&lt;BALAMT&gt;2020.66&lt;/BALAMT&gt;&lt;DTASOF&gt;20190917133617.000[-4:EDT]&lt;/DTASOF&gt;&lt;/AVAILBAL&gt;
      &lt;/STMTRS&gt;
  &lt;/STMTTRNRS&gt;
  &lt;/BANKMSGSRSV1&gt;
  &lt;/OFX&gt;
  </code></pre>
  
  <p>I want to be able to end with data that looks or acts like the following so that each row of data can easily be added to a database:
  <a href="https://i.stack.imgur.com/ijOz3.png" rel="nofollow noreferrer">Example Parse</a></p>