#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^([^:(,]*)\b"
Local $sString = "Boston (Boston University, Boston College, Bos..." & @CRLF & _
"Bridgewater (Bridgewater State College)[2]" & @CRLF & _
"Cambridge (Harvard University, Massachusetts I..." & @CRLF & _
"Chestnut Hill (Boston College)" & @CRLF & _
"The Colleges of Worcester Consortium:" & @CRLF & _
"Dudley (Nichols College)" & @CRLF & _
"Faribault, South Central College" & @CRLF & _
"Mankato (Minnesota State University, Mankato),..." & @CRLF & _
"Marshall (Southwest Minnesota State University..." & @CRLF & _
"Moorhead (Minnesota State University, Moorhead..." & @CRLF & _
"Morris (University of Minnesota Morris)[2]" & @CRLF & _
"Northfield (Carleton College, St. Olaf College..." & @CRLF & _
"North Mankato, South Central College" & @CRLF & _
"St. Cloud (St. Cloud State University, The Col..." & @CRLF & _
"St. Joseph (College of Saint Benedict)[2]" & @CRLF & _
"St. Peter (Gustavus Adolphus College)[2]"
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