#include <MsgBoxConstants.au3> ; to declare the Constants of MsgBox
Local $sRegex = "(?m)\[(\w+)\](.*)\[\/\1\]"
Local $sString = "" & @CRLF & _
"[shake2][wave]朝から私の大好きな[scream][big]死[/scream][/big]のにおいがするな...[/wave][/shake2]" & @CRLF & _
"[shake2]お前を殺すには骨がおれるが、しかし利益は大きい。ハッハッハ![/shake2]" & @CRLF & _
"[shake2]おや、心がおれそうだって?もう全てを放り出してあきらめたらどうだ。キッド[/shake2]" & @CRLF & _
"[shake2]そんなに死んでしまうのが好きなら、死とチューしちゃえばいいのに![/shake2]" & @CRLF & _
"何か無くなった気がするだって?もし、お前が[icon:camerabadge]カメラバッジを持っているなら、撮影ポーズ中に見回して、その[name]何か[/name]を探してみればいい..."
Local $sSubst = "$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