Updates regular expression match of []()] and [()\]] to ']' rather than '['