title: get before text of the matched string using R (text analysis)
body: <p>i want to get only text before the text matched string.</p>
  <p>For eg :</p>
  <pre><code>text :'Hello Ala, \r\r\n\r\r\nPlease perform receipting on line 12 of PO 78 so that the Invoices WB381 &amp; AU47  will be processed. \r\r\n\r\r\nShould you have any further questions please call us on 76 or email us quoting the reference number in the subject line of the email. We would be more than happy to help you.\r\r\n\r\r\nThanks &amp; Regards,\r\r\nMathen\r\r\n\r\r\nTo assist with your enquiry, our agents may record some personal data in our Ticketing system. This includes your full name, phone number and email address, you can request to modify this at any time. Recorded calls are stored for 2 months and used solely for the purposes of process improvement, agent training and quality reviews. For further information please see our privacy policy on R80.com\r\r\n------------------------------------------------------------------------------------------------\r\r\nTo: a.wall@xxx.xom\r\r\nFrom: procurementhelp@xxx.xom\r\r\nCC: \r\r\nDate: 2019-11-12 04:45:41\r\r\nSubject: RE:RE: RE:R80 78 On-hold Invoices Assistance Required\r\r\n\r\r\nHello Alastair, \r\r\n\r\r\nPlease be informed that our support team is working on the query. \r\r\n\r\r\nWe will get back to you as soon as we get a response from the team. \r\r\n\r\r\nShould you have any further questions please call us on 76 or email us quoting the reference number in the subject line of the email. We would be more than happy to help you.\r\r\n\r\r\nThanks &amp; Regards,\r\r\nMathen K Mathen\r\r\nGroup finance Consultant\r\r\nR80 Airways Limited ;\r\r\nP. 90\r\r\nE. procurementhelp@xxx.xom&lt;mailto:procurementhelp@xxx.xom&gt;\r\r\nR80.com | \r\r\n\r\r\nTo assist with your enquiry, our agents may record some personal data in our Ticketing system. This includes your full name, phone number and email address, you can request to modify this at any time. Recorded calls are stored for 2 months and used solely for the purposes of process improvement, agent training and quality reviews. For further information please see our privacy policy on R80.com\r\r\n------------------------------------------------------------------------------------------------\r\r\nTo: procurementhelp@ps.xxx.xom\r\r\nFrom: a.wall@xxx.xom\r\r\nCC: \r\r\nDate: 2019-11-07 23:18:59\r\r\nSubject: RE:RE: RE:R80 78 On-hold Invoices Assistance Required\r\r\n\r\r\nHi Team,\r\r\nI have never heard back on this query and there are now several invoices on hold that I cannot release.\r\r\nWB381\r\r\nWBFI420019397\r\r\nUPFI520009670\r\r\nAUNI220007659\r\r\nAUNI220007658\r\r\nAUNI220006740\r\r\nWBFI420015784\r\r\nUPFI520008050\r\r\nAUNI220006739\r\r\nAUNI220006741\r\r\nUPFI520006663\r\r\n\r\r\n\r\r\nKind Regards,\r\r\nAlastair Wall\r\r\nDomain Operations Lead\r\r\nR80 Engineering &amp; Flight Operations\r\r\n\r\r\nR80 Airways Limited ??\r\r\n10 Bourke Road, Mascot NSW 2020\r\r\nP. +61 2 9691 1491 (ext. 21491)\r\r\nM. +61 415 691 953\r\r\nE. a.wall@xxx.xom&lt;mailto:a.wall@xxx.xom&gt;\r\r\n\r\r\nR80.com&gt;\r\r\n\r\r\nOur team will be in contact with you within the next 48 hours. If this has not occurred, please call us on 78 / 79 or email us quoting the reference number for any further questions.\r\r\n\r\r\nThanks,\r\r\nMathen K Mathen\r\r\nGroup Finance Consultant\r\r\nR80 Airways Limited\r\r\nP. 78/ 79\r\r\nE. supplierhelp@xxx.xom&lt;mailto:supplierhelp@xxx.xom&gt; /procurementhelp@xxx.xom&lt;mailto:/procurementhelp@xxx.xom&gt;\r\r\n\r\r\nR80.com | facebook.com/R80 | twitter@R80 | youtube.com/R80\r\r\n\r\r\nTo assist with your enquiry, our agents may record some personal data in our Ticketing system. This includes your full name, phone number and email address, you can request to modify this at any time. Recorded calls are stored for 2 months and used solely for the purposes of process improvement, agent training.\r\r\n------------------------------------------------------------------------------------------------\r\r\nTo: ProcurementHelp@xxx.xom&lt;mailto:ProcurementHelp@xxx.xom&gt;\r\r\nFrom: a.wall@xxx.xom&lt;mailto:a.wall@xxx.xom&gt;\r\r\nCC:\r\r\nDate: 2019-10-22 02:39:07\r\r\nSubject: RE:78 On-hold Invoices Assistance Required\r\r\n\r\r\nHi team,\r\r\nWould you please assist with releasing the below pending invoices. The PO 78 is receipted above the invoiced amount so these should not be on-hold.\r\r\n\r\r\nUPFI520008050\r\r\n26-Sep-2019\r\r\nStandard\r\r\nTata Consultancy Svcs Ltd\r\r\nTCS BASELINE\r\r\nAUD\r\r\n20,000.00\r\r\n20,000.00\r\r\nIn Process - Pending Payment\r\r\nMax Amt Ord\r\r\nNot Paid\r\r\n10-NOV-2019\r\r\n78\r\r\n[cid:image001.gif@01D588DD.AF8F1F00]\r\r\nAUNI220006740\r\r\n26-Sep-2019\r\r\nStandard\r\r\nTata Consultancy Svcs Ltd\r\r\nTCS BASELINE\r\r\nAUD\r\r\n5,500.00\r\r\n5,500.00\r\r\nIn Process - Pending Payment\r\r\nMax Amt Ord\r\r\nNot Paid\r\r\n10-NOV-2019\r\r\n78\r\r\n[cid:image001.gif@01D588DD.AF8F1F00]\r\r\nWBFI420015784\r\r\n26-Sep-2019\r\r\nStandard\r\r\nTata Consultancy Svcs Ltd\r\r\nTCS BASELINE\r\r\nAUD\r\r\n1,400.00\r\r\n1,400.00\r\r\nIn Process - Pending Payment\r\r\nMax Amt Ord\r\r\nNot Paid\r\r\n10-NOV-2019\r\r\n78\r\r\n\r\r\nRef:MSG24764190\r\r\n'
  </code></pre>
  <p>i want to find the pattern <code>'\r\r\n------------------------------------------------------------------------------------------------\r\r\n'</code> from the text.
  then only want to get the data from first matched text</p>
  <p>output:</p>
  <pre><code>Hello Ala, 
  
  Please perform receipting on line 12 of PO 78 so that the Invoices WB381 &amp; AU47  will be processed. 
  
  Should you have any further questions please call us on 76 or email us quoting the reference number in the subject line of the email. We would be more than happy to help you
  
  Thanks &amp; Regards,
  Mathen 
  
  To assist with your enquiry, our agents may record some personal data in our Ticketing system. This includes your full name, phone number and email address, you can request to modify this at any time. Recorded calls are stored for 2 months and used solely for the purposes of process improvement, agent training and quality reviews. For further information please see our privacy policy on R80.com
  </code></pre>