#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)^.*?\+?0*610?(\d{3})(\d{3})(\d{4})(?!\d).*$"
Local $sString = "xgsh6101231231234vvajxxgsh6101231231234vvajx" & @CRLF & _
"xgsh06101231231234vvajx" & @CRLF & _
"xgsh000006101231231234vvajx" & @CRLF & _
"+6101231231234" & @CRLF & _
"xgsh61012312312345vvajx" & @CRLF & _
"xgsh5101231231234vvajx" & @CRLF & _
"xgsh00000101231231234vvajx" & @CRLF & _
"xgsh6143545626455345601231231234vvajx" & @CRLF & _
""
Local $sSubst = "+61 (0) $1 $2 $3"
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