#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?x) (?:\([^()]*) # Match '( ....'" & @CRLF & _
" (?:\d+,\ ){2,} # Our regex in '( ..... )'" & @CRLF & _
" (?:[^()]*\)) # Match '..... )'" & @CRLF & _
" (*SKIP)(*FAIL) # Fail the first alternative" & @CRLF & _
"| # Second alternative" & @CRLF & _
" (?:\d+,\ ){2,} # Our regex not enclosed in '( ... )'" & @CRLF & _
""
Local $sString = "Albemarle Paper Co. v Moody (1975) 422 US 405, 425, 95 S Ct 2362 (Booboo)" & @CRLF & _
"Albemarle Paper Co. v Moody (1975) 422 US 405, 95 S Ct 2362" & @CRLF & _
"Aerotek, Inc. v Johnson Group Staffing Co. (July 30, 2013, C067652) 2013 Cal Unpub Lexis 5424"
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