#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)(.*)\s*\((.*?)\)|(.*)"
Local $sString = "Aerospace Technologies of Australia Pty Ltd (Australia)" & @CRLF & _
"American Tactical Aircraft Consultants (United States)" & @CRLF & _
"ATEC vos (Czech Republic)" & @CRLF & _
"Aviation Technology Group Inc (United States)" & @CRLF & _
"Atlas Aircraft Corporation of South Africa (Pty) Ltd (South Africa)" & @CRLF & _
"GIE Avions de Transport Régional (France/Italy)" & @CRLF & _
"Auster Aircraft Ltd (United Kingdom)" & @CRLF & _
"Austflight ULA Pty Ltd (Australia)" & @CRLF & _
"Australian Aerospace Pty Ltd (Australia)" & @CRLF & _
"Australite Inc (United States)" & @CRLF & _
"AutoGyro Europe GmbH (Germany)" & @CRLF & _
"OOO Samoletstroitelynyi Kompaniya Avantazh (Russia)" & @CRLF & _
"AvCraft Aviation LLC (United States)" & @CRLF & _
"Aveko sro (Czech Republic)" & @CRLF & _
"Azionari Vercellese Industrie Aeronautiche (Italy)" & @CRLF & _
"Avia-Zavody Jirího Dimitrova (Czech Republic)" & @CRLF & _
"see AERFER and AERMACCHI"
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