#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)\bGrand Total\s+(.*)"
Local $sString = " Credit Note InterGlobe Aviation Limited" & @CRLF & _
" (Original For Recipient)" & @CRLF & _
"Jorhat Airport" & @CRLF & _
" Airport Road" & @CRLF & _
" Raraiyah" & @CRLF & _
" Jorhat" & @CRLF & _
" Assam" & @CRLF & _
" 785006" & @CRLF & _
"GSTIN : 18AABCI2726B1Z1" & @CRLF & _
"Number : AS2181901AB01561" & @CRLF & _
"Date : 23-Jan-2019" & @CRLF & _
"Passenger Name :" & @CRLF & _
" " & @CRLF & _
"PNR : KFRFUZ Flight No : 6E - 5988 From : JRH To : CCU Place of Supply : Haryana" & @CRLF & _
"GSTIN of Customer : 06AAACM0829Q1Z8" & @CRLF & _
"GSTIN Customer Name : MARUTI SUZUKI INDIA LIMITED" & @CRLF & _
" " & @CRLF & _
"Currency : INR" & @CRLF & _
"NonTaxable IGST CGST SGST/UGST" & @CRLF & _
"Taxable Total(Incl" & @CRLF & _
"Description SAC Code /Exempted Total" & @CRLF & _
"Value" & @CRLF & _
"Tax % Amount Tax % Amount Tax % Amount" & @CRLF & _
"Taxes)" & @CRLF & _
"Value" & @CRLF & _
"Airport Charges 0.00 3,837.00 3,837.00" & @CRLF & _
"0.00 0.00 0.00 0.00 0.00 0.00" & @CRLF & _
"3,837.00" & @CRLF & _
"Grand Total" & @CRLF & _
"0.00 3,837.00 3,837.00 0.00 0.00 0.00 3,837.00" & @CRLF & _
"Original Invoice Number: AS1181901AI71392 Date: 15-Jan-2019" & @CRLF & _
"1. Air Travel and related Charges :- Includes all Charges related to air transportation of passengers" & @CRLF & _
"2. Airport Charges :- Includes ADF,UDF,PSF and other airport charges collected on behalf of Airport Operator,as applicable" & @CRLF & _
"3. Misc. Services :- Includes Charges of Lounge,Medical Assistance and Travel Certificate" & @CRLF & _
"4. Meal :- Includes all prepaid meals purchased before travel" & @CRLF & _
"5. Good Karma :- Includes contributions made towards IndiGo's Good Karma initiative and Clear the Air initiative" & @CRLF & _
" made at the time of reservation" & @CRLF & _
"6. Amounts have been rounded off." & @CRLF & _
" InterGlobe Aviation Limited" & @CRLF & _
" Registered Office: Central Wing, Ground Floor, Thapar House, 124 Janpath, New Delhi -110001,India." & @CRLF & _
" F 011-43513200. Email: corporate@goindigo.in" & @CRLF & _
" Corporate Office: Level 1, Tower C, Global Business park, MG Road, Gurgaon-122002, Haryana,India." & @CRLF & _
" T +91 124 435 2500. F +91 124 406 8536 goindigo.in" & @CRLF & _
" CIN no. L62100DL2004PLC129768 , PAN no. AABCI2726B"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm