#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)w|[ehmors]e|[^u]es|duc|[dn]y"
Local $sString = "lioness" & @CRLF & _
"hen" & @CRLF & _
"mare" & @CRLF & _
"cow" & @CRLF & _
"duck" & @CRLF & _
"sow" & @CRLF & _
"doe" & @CRLF & _
"ewe" & @CRLF & _
"goose" & @CRLF & _
"nanny" & @CRLF & _
"queen" & @CRLF & _
"princess" & @CRLF & _
"empress" & @CRLF & _
"duchess" & @CRLF & _
"marchioness" & @CRLF & _
"countess" & @CRLF & _
"baroness" & @CRLF & _
"baronetess" & @CRLF & _
"lady" & @CRLF & _
"dame" & @CRLF & _
"" & @CRLF & _
"lion" & @CRLF & _
"rooster" & @CRLF & _
"stallion" & @CRLF & _
"bull" & @CRLF & _
"drake" & @CRLF & _
"boar" & @CRLF & _
"buck" & @CRLF & _
"ram" & @CRLF & _
"gander" & @CRLF & _
"billy" & @CRLF & _
"king" & @CRLF & _
"prince" & @CRLF & _
"emperor" & @CRLF & _
"duke" & @CRLF & _
"marquess" & @CRLF & _
"earl" & @CRLF & _
"baron" & @CRLF & _
"baronet" & @CRLF & _
"lord" & @CRLF & _
"knight"
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