#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(\b.+)(?=\1)"
Local $sString = "..." & @CRLF & _
"bedeubedeu France The Provençal name for tripe" & @CRLF & _
"bee balmbee balm Bergamot" & @CRLF & _
"beechmastbeechmast Beech nut" & @CRLF & _
"beech nutbeech nut A small nut from the beech tree," & @CRLF & _
"" & @CRLF & _
"genus Fagus and Nothofagus, similar in" & @CRLF & _
"flavour to a hazelnut but not commonly used." & @CRLF & _
"A flavoursome oil can be extracted from" & @CRLF & _
"them. Also called beechmast" & @CRLF & _
"" & @CRLF & _
"beechwheatbeechwheat Buckwheat" & @CRLF & _
"beefbeef The meat of the animal known as a cow" & @CRLF & _
"" & @CRLF & _
"(female) or bull (male) (NOTE: The Anglo-" & @CRLF & _
"saxon name ‘Ox’ is still used for some of what" & @CRLF & _
"were once the less desirable parts e.g. oxtail," & @CRLF & _
"ox liver)" & @CRLF & _
"" & @CRLF & _
"beef bourguignonnebeef bourguignonne See boeuf à la" & @CRLF & _
"bourguignonne" & @CRLF & _
"..."
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