On this page
  1. sre_constants.error
  2. Import
  3. Signature & Overview
  4. Methods & Attributes
  5. Usage
  6. Gotchas
  7. REPL Inspect

sre_constants.error

Up: sre_constants | Next: sre_constants.PatternError
Rel: sre_constants.PatternError
Ref: docs.python.org โ€” sre_constants.error
Tags: #public #python3 #stdlib #sre_constants


Import

import sre_constants
from sre_constants import error

Signature & Overview

sre_constants.error(msg, pattern=None, pos=None)

Exception raised for invalid regular expressions.

Methods & Attributes

Usage

import re

# Use re.error directly
assert issubclass(re.error, Exception)

Gotchas

REPL Inspect

from sre_constants import error
help(error)

Linked from

Related notes