#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?xim)(?:[^[:alpha:]-]|^)" & @CRLF & _
"(" & @CRLF & _
" [[:alpha:]]{2,}(?:-[[:alpha:]]{2,})?|" & @CRLF & _
" -[[:alpha:]]{2,}|" & @CRLF & _
" [[:alpha:]]{2,}-" & @CRLF & _
")" & @CRLF & _
"[^[:alpha:]-]" & @CRLF & _
"(?:(?:.*?[^[:alpha:]-])?\1(?:[^[:alpha:]-]|$)){2}"
Local $sString = "-bad girls, -bad boys,-bad phone. phone phone mam: phone phone? " & @CRLF & _
"wup, wup, BORAK OBAMA OBAMA MAMA; it is OBAMA . " & @CRLF & _
"hustone, we have a problem, big problem. Very big, big, big" & @CRLF & _
"high cost - high perfomance, high " & @CRLF & _
"full-hd,tv-full,full-hd:full-hd" & @CRLF & _
"1 Fooo fooo fooo , fooo-- fooo-- " & @CRLF & _
"2 fooo feee faaa , fooo-fooo, fooo-fooo."
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