#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(\b\S+\b)(?=.*\b\1\b)"
Local $sString = "123-1 123-2 test-1 test-1 w/e 10/04/20" & @CRLF & _
"Company w/e 09/06/20 083020-090620" & @CRLF & _
"a/b 01/01" & @CRLF & _
"test_1 test_2" & @CRLF & _
"a/b a/b" & @CRLF & _
"Inv 50049 50049 Inv 50195 PrjPAN02" & @CRLF & _
"Inv 51360-1, 51366-7; 51372 Inv 51360-1, 51366-7; 372 PrjPAN02" & @CRLF & _
"Inv 51360-1, 51366-7; 51372 51372 Inv 513601, 51366-7; 372 PrjPAN02" & @CRLF & _
"55009, 55017, 55022 55001, 55022, 55025" & @CRLF & _
"55254, 61 55246,66,69" & @CRLF & _
"55733, 41, 44 55727, 45,48" & @CRLF & _
"57269, 71,74,75, 57354 57266, 73" & @CRLF & _
"57437, 38, 41, 43 57434, 40" & @CRLF & _
"w/e 09/20/20 091320-092020"
Local $sSubst = """"
Local $sResult = StringRegExpReplace($sString, $sRegex, $sSubst)
MsgBox($MB_SYSTEMMODAL, "Result", $sResult)
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