#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)(?<=a\/c|acc|account|ref|reference)\b\D+[0-9A-Za-z\-\\\/]+"
Local $sString = "My acc reference is 123456" & @CRLF & _
"" & @CRLF & _
"My reference number is 123-456" & @CRLF & _
"" & @CRLF & _
"My a/c reference number is 123-4556A" & @CRLF & _
"A/c number is 123-3456" & @CRLF & _
"" & @CRLF & _
"This is another ref. number: 123/567-2B" & @CRLF & _
"" & @CRLF & _
"cat and kitten both refer to cats." & @CRLF & _
"" & @CRLF & _
"He made reference in his novel to the 1929 census." & @CRLF & _
"" & @CRLF & _
"This data uses information from the financial year 1992/93 and also makes references to 90/91 figures." & @CRLF & _
"" & @CRLF & _
"The background property refers to a hexidecimal colour, H102567." & @CRLF & _
"" & @CRLF & _
"My a/c reference number is 123/456"
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