#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)<:([^<:>\s]+?):>"
Local $sString = "regex is /<:([^<:>\s]+?):>/gm" & @CRLF & _
"Define custom tag : <:tag_name:>" & @CRLF & _
"prefix is "<:"" & @CRLF & _
"suffix is ":>"" & @CRLF & _
"tag_name can not contain prefix, suffix, space, tab or newline character." & @CRLF & _
"tag_name can not be null." & @CRLF & _
"" & @CRLF & _
"test string as below:" & @CRLF & _
"" & @CRLF & _
"<:ab我c:><<:abc:>:<:ab_c:>a<:ab c:>b<:abc:><:abc:>c:<:abc:>><:abc:>" & @CRLF & _
"<:<:efg<:efg:>:>e<:<:efg<:ef g:>:>efg<:<:efg:>efg:>:>fg<:<:efg:>efg:>:>"
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