select regexp_replace(aa,'[\[\]]','') from ( select unnest(string_to_array('[北京;上海]',';')) as aa )tb01