#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(In\s(?P<lang>[^-]+))?(?(1)-|)((?P<home>.+)\svs\.\s+(?P<away>.+)\s+)\((?P<league>[^\)]+)"
Local $sString = "In Spanish-Vitesse vs. Feyenoord (Eredivisie)" & @CRLF & _
"Vitesse vs. Feyenoord (Eredivisie)" & @CRLF & _
"Hyderabad vs. Mumbai City FC (Indian Super League)" & @CRLF & _
"Kilmarnock vs. Aberdeen (Scottish Premier League)" & @CRLF & _
"In Spanish-ADO Den Haag vs. Ajax (Eredivisie)" & @CRLF & _
"ADO Den Haag vs. Ajax (Eredivisie)" & @CRLF & _
"Sassuolo vs. AC Milan (Serie A)" & @CRLF & _
"In Spanish-Sassuolo vs. AC Milan (Serie A)" & @CRLF & _
"Cagliari vs. Udinese (Serie A)" & @CRLF & _
"In Spanish-Inter vs. Spezia (Serie A)" & @CRLF & _
"Inter Milan vs. Spezia (Serie A)" & @CRLF & _
"Benevento vs. Genoa (Serie A)" & @CRLF & _
"Kerala Blasters FC vs. SC East Bengal (Indian Super League)" & @CRLF & _
"Celtic vs. Heart of Midlothian (Final) (Scottish Cup)" & @CRLF & _
"Sport-Club Freiburg vs. Hertha BSC (Bundesliga)" & @CRLF & _
"Abilene Christian vs. Stetson (W Basketball)" & @CRLF & _
"In Spanish-VfL Wolfsburg vs. VfB Stuttgart (Bundesliga)" & @CRLF & _
"VfL Wolfsburg vs. VfB Stuttgart (Bundesliga)" & @CRLF & _
"In Spanish-Atalanta vs. AS Roma (Serie A)" & @CRLF & _
"Atalanta vs. AS Roma (Serie A)" & @CRLF & _
"Kobenhaven vs. OB (Danish Superliga)" & @CRLF & _
"East Carolina vs. Cincinnati (W Basketball)" & @CRLF & _
"Delaware vs. George Washington (W Basketball)" & @CRLF & _
"Northern Kentucky vs. Purdue Fort Wayne (W Basketball)" & @CRLF & _
"Jackson State vs. Iowa State (M Basketball)" & @CRLF & _
"Cleveland State vs. IUPUI (W Basketball)" & @CRLF & _
"Western Carolina vs. Georgia State (W Basketball)" & @CRLF & _
"Robert Morris vs. Milwaukee (W Basketball)" & @CRLF & _
"Albany vs. UMBC (W Basketball)" & @CRLF & _
"SMU vs. Temple (W Basketball)" & @CRLF & _
"Appalachian State vs. East Tennessee State (W Basketball)" & @CRLF & _
"Binghamton vs. Stony Brook (W Basketball)" & @CRLF & _
"UMass Lowell vs. Vermont (W Basketball)" & @CRLF & _
"Alice Lloyd vs. UNC Greensboro (M Basketball)" & @CRLF & _
"UNC Asheville vs. High Point (W Basketball)" & @CRLF & _
"Ball State vs. Akron (W Basketball)" & @CRLF & _
"South Carolina State vs. Campbell (W Basketball)" & @CRLF & _
"Oakland vs. Wright State (W Basketball)" & @CRLF & _
"VCU vs. Richmond (W Basketball)" & @CRLF & _
"Lazio vs. Napoli (Serie A)" & @CRLF & _
"In Spanish-Lazio vs. Napoli (Serie A)" & @CRLF & _
"Freed-Hardeman (TN) vs. North Alabama (M Basketball)" & @CRLF & _
"Western Kentucky vs. Tennessee Tech (W Basketball)" & @CRLF & _
"Chicago State vs. Drake (M Basketball)" & @CRLF & _
"Martin Methodist vs. Troy (W Basketball)" & @CRLF & _
"Louisiana vs. Louisiana Tech (W Basketball)" & @CRLF & _
"Champion Christian vs. Arkansas State (M Basketball)" & @CRLF & _
"Alcorn State vs. Houston (M Basketball)" & @CRLF & _
"Oakland vs. UIC (M Basketball)" & @CRLF & _
"Detroit Mercy vs. UIC (W Basketball)" & @CRLF & _
"Western Illinois vs. UT Martin (M Basketball)" & @CRLF & _
"NJIT vs. Temple (M Basketball)" & @CRLF & _
"Lamar vs. Texas State (W Basketball)" & @CRLF & _
"Converse vs. Coastal Carolina (W Basketball)" & @CRLF & _
"Flagler vs. North Florida (M Basketball)" & @CRLF & _
"Southeastern Louisiana vs. Tulane (W Basketball)" & @CRLF & _
"Iona vs. Rider (M Basketball)" & @CRLF & _
"McNeese State vs. Louisiana (M Basketball)" & @CRLF & _
"Crowley's Ridge vs. Tennessee State (M Basketball)"
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