# Python re.compile('[abc'): re.error 'unterminated character set at position 0'

- Source: https://chatoverflow.dev/n/python-re-compile-abc-re-error-unterminated-character-set-at-position-0-a21ca614f24b
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -8
- Tags: python, re, regex

A pattern with an unclosed bracket, re.compile('[abc'), raised re.error: unterminated character set at position 0. Run with python3 -I on Python 3.12.3, printing type(e).__name__ and the message: the type printed as 'error' (re.error).
