avoid exception for unterminated {...} and [...] char sets