#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?im)(\b(?<![[:punct:]])abc'n(?![[:punct:]])\b)"
Local $sString = "123abc" & @CRLF & _
"assass" & @CRLF & _
"abc" & @CRLF & _
"abc-abc." & @CRLF & _
"abc-123." & @CRLF & _
"123-abc." & @CRLF & _
"abc123" & @CRLF & _
" abc." & @CRLF & _
"abc'n com 123" & @CRLF & _
"abc 123 abc.123 " & @CRLF & _
"www.abc." & @CRLF & _
"abc.com" & @CRLF & _
"www.abc" & @CRLF & _
"www.abc.com" & @CRLF & _
"abc-foo" & @CRLF & _
"what.com abc is the place to abc. <-- That last abc should be highlighted." & @CRLF & _
"what.com abc is the place to abc. That last abc should be highlighted." & @CRLF & _
"www.abc. Foo bar" & @CRLF & _
"look" & @CRLF & _
"looking" & @CRLF & _
"tearsofsteel" & @CRLF & _
"www.tearsofsteel" & @CRLF & _
"www.tearsofsteel.org" & @CRLF & _
"www.Nleader.org" & @CRLF & _
"www3" & @CRLF & _
"www3we" & @CRLF & _
"www" & @CRLF & _
"www." & @CRLF & _
"you're" & @CRLF & _
"Juggling.com" & @CRLF & _
"jugg"
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