#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?sx)(?sx)" & @CRLF & _
"(?|" & @CRLF & _
"0(?=.*(0))" & @CRLF & _
"|1(?=.*(1))" & @CRLF & _
"|2(?=.*(2))" & @CRLF & _
"|3(?=.*(3))" & @CRLF & _
"|4(?=.*(4))" & @CRLF & _
"|5(?=.*(5))" & @CRLF & _
"|6(?=.*(6))" & @CRLF & _
"|7(?=.*(7))" & @CRLF & _
"|8(?=.*(8))" & @CRLF & _
"|9(?=.*(9))" & @CRLF & _
")"
Local $sString = "0 zero " & @CRLF & _
"1 ichi " & @CRLF & _
"2 ni " & @CRLF & _
"3 san " & @CRLF & _
"4 shi " & @CRLF & _
"5 go" & @CRLF & _
"6 roku" & @CRLF & _
"7 shichi" & @CRLF & _
"8 hachi" & @CRLF & _
"9 kyuu" & @CRLF & _
"0123456789"
Local $sSubst = "\1"
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