#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?<!#)(?:(?<=_FILE).+"(.+)")"
Local $sString = "# ---------------------------------------------------------------------------- #" & @CRLF & _
"# Packages" & @CRLF & _
"# ---------------------------------------------------------------------------- #" & @CRLF & _
"" & @CRLF & _
"set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "file_1_test_1_qip.vhd"]" & @CRLF & _
"set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "file_2_test_1_qip.vhd"]" & @CRLF & _
"set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "file_3_test_1_qip.vhd"]" & @CRLF & _
"" & @CRLF & _
"# Register Tool set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "file_INVALID_test_1_qip.vhd"]" & @CRLF & _
"" & @CRLF & _
"# ---------------------------------------------------------------------------- #" & @CRLF & _
"# Sub Modules" & @CRLF & _
"# ---------------------------------------------------------------------------- #" & @CRLF & _
"" & @CRLF & _
"set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) "module_test_2.qip"]" & @CRLF & _
"set_global_assignment -name QIP_FILE [file join $::quartus(qip_path) "module_test_3.qip"]" & @CRLF & _
"" & @CRLF & _
"# ---------------------------------------------------------------------------- #" & @CRLF & _
"# Module Files" & @CRLF & _
"# ---------------------------------------------------------------------------- #" & @CRLF & _
"" & @CRLF & _
"set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "file_4_test_1_qip.vhd"]" & @CRLF & _
"set_global_assignment -name VHDL_FILE [file join $::quartus(qip_path) "file_5_test_1_qip.vhd"]"
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