#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)199\d{1}|20\d{2}|\d{2}(?![/,\-\w ])"
Local $sString = "04/20/2001; 04/20/11; 4/20/09; 4/3/01" & @CRLF & _
"Mar-20-2001; Dec 20, 2009; April 20, 2009; Mar. 20, 2009; Mar 20 2009;" & @CRLF & _
"20 Mar 2001; 20 April 2001; 20 Mar. 2007; 20 March, 2009" & @CRLF & _
"Mar 21th, 2009; Mar 21st, 2009; Feb 22nd, 2002" & @CRLF & _
"Feb 2009; Sep 2009; Nov 2016" & @CRLF & _
"6/2008; 12/2009" & @CRLF & _
"2003; 2012"
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