Fixed parsing for [] in =~ regex