# If you'd like to omit non-matching lines from the result; add ';d' to the end of the expression.
sed -E 's/\[(\\/?\w+\:?\w+)\]/$2/gm;t' <<< "
[shake2][wave]朝から私の大好きな[scream][big]死[/scream][/big]のにおいがするな...[/wave][/shake2]
[shake2]お前を殺すには骨がおれるが、しかし利益は大きい。ハッハッハ![/shake2]
[shake2]おや、心がおれそうだって?もう全てを放り出してあきらめたらどうだ。キッド[/shake2]
[shake2]そんなに死んでしまうのが好きなら、死とチューしちゃえばいいのに![/shake2]
何か無くなった気がするだって?もし、お前が[icon:camerabadge]カメラ バッジを持っているなら、撮影ポーズ中に見回して、その[name]何か[/name]を探してみればいい...
\[(\w+)\](.*)\[\/\1\]"
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 SED, please visit: https://www.gnu.org/software/sed/manual/html_node/The-_0022s_0022-Command.html