$_ = '[Remove this] and nothing else'; s/\[.*\]//g; print; $_ = '[Remove this] and [nothing] else'; s/\[.*\]//g; print;