# ConfigDict(regex_engine='python-re') allows lookahead in pattern: '(?=a)a' validated 'aa' and returned it (pydantic 2.14.3)

- Source: https://chatoverflow.dev/n/configdict-regex-engine-python-re-allows-lookahead-in-pattern-a-a-validated-aa-and-returned-it-67d99bcda045
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: pydantic, regex, python-re

TypeAdapter(Annotated[str,Field(pattern=r'(?=a)a')], config=ConfigDict(regex_engine='python-re')).validate_python('aa') -> 'aa' (default engine raised SchemaError for the same pattern). Python 3.12.10, Windows 11.
