#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(?<=Project\s+#.*\r?\n?)(?<Item>.+)\s+\r?\n?(?:Total\s+Cost:\s+)(?<TotalCost>[\d.,\$]+)\r?\n?(?:City\s+Obligation:\s+)(?<CityObligation>[\d.,\$]+)\r?\n?(?:Delivery\s+Method:\s+)(?<DeliveryMethod>.+)\r?\n?(?:Cooperating\s+Agencies:\s+)(?<CooperatingAgencies>.+)\r?\n?\r?\n?(?:Special\s+Circumstances)\r?\n?\r?\n?(?<SC>.+)"
Local $sString = "Facilities Management" & @CRLF & _
"Project #: 0450-CARP" & @CRLF & _
"Replace Carpet - City Hall" & @CRLF & _
"" & @CRLF & _
"Total Cost: $243,203" & @CRLF & _
"City Obligation: $200,000" & @CRLF & _
"Delivery Method: TBD" & @CRLF & _
"Cooperating Agencies: None" & @CRLF & _
"" & @CRLF & _
"Special Circumstances" & @CRLF & _
"" & @CRLF & _
"None" & @CRLF & _
"" & @CRLF & _
"Project Description Location: One City Plaza - City Hall" & @CRLF & _
"Remove and Replace the carpet at City Hall." & @CRLF & _
"" & @CRLF & _
"Project Justification" & @CRLF & _
"The carpet at City Hall is 18 years old, with some areas failing and causing a trip hazard." & @CRLF & _
"The carpet needs replacement in phases over the next 4-5 years, beginning in Fiscal" & @CRLF & _
"Year 20 and ending in Fiscal Year 24." & @CRLF & _
"" & @CRLF & _
"Budget Impact/Other" & @CRLF & _
"Statement of Impact: There is no impact to the City’s operating budget." & @CRLF & _
"" & @CRLF & _
"Expenditures Previous 2021 2022 2023 2024 2025 Out Total" & @CRLF & _
"Years Years" & @CRLF & _
"Other $43,203 $50,000 $50,000 $50,000 $50,000 $243,203" & @CRLF & _
"Total $43,203 $50,000 $50,000 $50,000 $50,000 $243,203" & @CRLF & _
"" & @CRLF & _
"Funding Previous 2021 2022 2023 2024 2025 Out Total" & @CRLF & _
"Sources Years Years" & @CRLF & _
"General Fund $43,203 $50,000 $50,000 $50,000 $50,000 $243,203" & @CRLF & _
"" & @CRLF & _
"Total $43,203 $50,000 $50,000 $50,000 $50,000 $243,203" & @CRLF & _
"" & @CRLF & _
"FY 2021 - FY 2025 Capital Improvement Program Page 18 Effective July 1, 2020"
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