#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)(?:\[|\G(?!^))\K[^][](?=[^][]*])"
Local $sString = "$lang['activate_deactivate'] = "Activate / Deactivate";" & @CRLF & _
"$lang['invalid_username'] = "Invalid username";" & @CRLF & _
"$lang['you_must_enter_username'] = "You must enter username";" & @CRLF & _
"$lang['invalid_user_name'] = "Invalid username";" & @CRLF & _
"$lang['user_deactivated'] = "User has been deactivated";" & @CRLF & _
"$lang['user_not_deactivated'] = "User could not be deactivated";"
Local $sSubst = "$0█"
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