#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?'group1'[\d])"
Local $sString = "101011010" & @CRLF & _
"110101101" & @CRLF & _
"111010110" & @CRLF & _
"111101011" & @CRLF & _
"011110101" & @CRLF & _
"101111010" & @CRLF & _
"110111101" & @CRLF & _
"011011110" & @CRLF & _
"001101111" & @CRLF & _
"100110111" & @CRLF & _
"110011011" & @CRLF & _
"111001101" & @CRLF & _
"111100110" & @CRLF & _
"011110011" & @CRLF & _
"001111001" & @CRLF & _
"100111100" & @CRLF & _
"010011110" & @CRLF & _
"001001111" & @CRLF & _
"100100111" & @CRLF & _
"010010011" & @CRLF & _
"001001001" & @CRLF & _
"000100100" & @CRLF & _
"000010010" & @CRLF & _
"000001001" & @CRLF & _
"000000100" & @CRLF & _
"000000010" & @CRLF & _
"100000001"
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