#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m).*tax"
Local $sString = "Year" & @CRLF & _
"Qtr" & @CRLF & _
"CASH FLOWS FROM OPERATING ACTIVITIES" & @CRLF & _
"Profit before tax" & @CRLF & _
"Depreciation of property, plant and equipment" & @CRLF & _
"Interest expense" & @CRLF & _
"Unrealised gain on foreign exchange" & @CRLF & _
"Interest income" & @CRLF & _
"Gain on disposal of property, plant and equipment" & @CRLF & _
"Writeback of allowance for impairment losses on trade receivables" & @CRLF & _
"Plant and equipment written off" & @CRLF & _
"Allowance for impairment losses on receivables" & @CRLF & _
"Bad debt written off" & @CRLF & _
"Gain on disposal of an associate" & @CRLF & _
"Share of results of associates" & @CRLF & _
"Operating profit before working capital changes" & @CRLF & _
"Inventories" & @CRLF & _
"Trade receivables" & @CRLF & _
"Other receivables, deposits and prepaid expenses" & @CRLF & _
"Amount owing by an associate" & @CRLF & _
"Trade payables" & @CRLF & _
"Other payables and accrued expenses" & @CRLF & _
"Cash generated from operations" & @CRLF & _
"Taxes paid" & @CRLF & _
"Net cash from operating activities" & @CRLF & _
"CASH FLOWS FOR INVESTING ACTIVITIES" & @CRLF & _
"Interest received" & @CRLF & _
"Additional investment of a subsidiary" & @CRLF & _
"Purchase of property, plant and equipment" & @CRLF & _
"Proceeds from disposal of property, plant and equipment" & @CRLF & _
"Proceeds from disposal of an associate" & @CRLF & _
"Net (placement)/withdrawal of fixed deposits with licensed banks" & @CRLF & _
"Net cash for investing activities" & @CRLF & _
"CASH FLOWS FOR FINANCING ACTIVITIES" & @CRLF & _
"Interest paid" & @CRLF & _
"Dividend paid by the Company" & @CRLF & _
"Dividend paid by a subsidiary to non-controlling interests" & @CRLF & _
"Repayment of term loans" & @CRLF & _
"Payment of lease liabilities" & @CRLF & _
"Net cash for financing activities" & @CRLF & _
"NET INCREASE IN CASH AND CASH EQUIVALENTS" & @CRLF & _
"CASH AND CASH EQUIVALENTS AT BEGINNING OF FINANCIAL YEAR" & @CRLF & _
"EFFECT OF EXCHANGE DIFFERENCES" & @CRLF & _
"CASH AND CASH EQUIVALENTS AT END OF FINANCIAL YEAR" & @CRLF & _
"THE CASH AND CASH EQUIVALENTS COMPRISE" & @CRLF & _
"Cash and bank balances" & @CRLF & _
"Fixed deposits with licensed banks" & @CRLF & _
"Short-term investments" & @CRLF & _
"Less: Fixed deposits pledged with banks" & @CRLF & _
"Less: Fixed deposits with maturity more than 3 months" & @CRLF & _
"Cash and cash equivalents" & @CRLF & _
""
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