#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?mu)(?:([-‐‑‒–—―−⁃﹘﹣-])|(?:&(?:(?:#x(2d|201[0-5]|2212|2043|fe58|fe63|ff0d))|(?:#(45|820[89]|821[0123]|8722|8259|65112|65123|65293))|(hyphen|[nm]?dash|hybull|horbar|minus));?))"
Local $sString = "This captures an entity even if it lacks the ';', which is commonly encountered in the wild." & @CRLF & _
"" & @CRLF & _
"kbdash - - - - -; -" & @CRLF & _
"dash ‐ ‐ ‐ ‐ ‐ ‐; ‐" & @CRLF & _
"hyphen ‑ ‐ ‑ ‑ ‑ ‑; ‑" & @CRLF & _
"figure ‒ ‒ ‒ ‒ ‒; ‒" & @CRLF & _
"em – – – – – –; –" & @CRLF & _
"en — — — — — —; —" & @CRLF & _
"horbar ― ― ― ― ― ―; ―" & @CRLF & _
"minus − − − − − −; −" & @CRLF & _
"hybull ⁃ ⁃ ⁃ ⁃ ⁃ ⁃; ⁃" & @CRLF & _
"fe58 ﹘ ﹘ ﹘ ﹘ ﹘; ﹘" & @CRLF & _
"fe63 ﹣ ﹣ ﹣ ﹣ ﹣; ﹣" & @CRLF & _
"ff0d - - - - -; -" & @CRLF & _
"" & @CRLF & _
"(?:([-‐‑‒–—―−⁃﹘﹣-])|(?:&(?:(?:#x(2d|201[0-5]|2212|2043|fe58|fe63|ff0d))|(?:#(45|820[89]|821[0123]|8722|8259|65112|65123|65293))|(hyphen|[nm]?dash|hybull|horbar|minus));?))"
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