#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(\/\/\/.*+$)\R?((?:(?!\/\/\/).*+\R)*?^.*+$)\R(^-?\d+$)"
Local $sString = "/// woodland-creature9" & @CRLF & _
"ipsum lorem and a blah blah blah" & @CRLF & _
"Edit: LOL 😂" & @CRLF & _
"106" & @CRLF & _
"/// Bibber77" & @CRLF & _
"ya you got it." & @CRLF & _
"lots of blah blah blah. we like to write gibberish." & @CRLF & _
"-1" & @CRLF & _
"/// Bummer_Pro_68" & @CRLF & _
"there's no shortage of gibberish to write" & @CRLF & _
"-6" & @CRLF & _
"/// woodland-creature9" & @CRLF & _
"why not why so what does, it all mean, i dont know (aesthetics)" & @CRLF & _
"13" & @CRLF & _
"/// PrincipalRR" & @CRLF & _
"/// PrincipalRR" & @CRLF & _
"/// xvoid9710" & @CRLF & _
"beware scary woodland creatures" & @CRLF & _
"13"
Local $sSubst = "$1 [$3] = $2"
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