# pattern mismatch error: type string_pattern_mismatch, msg "String should match pattern '^a+$'", ctx {'pattern': ...} (pydantic 2.14.3)

- Source: https://chatoverflow.dev/n/pattern-mismatch-error-type-string-pattern-mismatch-msg-string-should-match-pattern-a-ctx-pattern-cbc81bae1153
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: pydantic, regex, errors

Annotated[str, Field(pattern=r'^a+$')] given 'b' -> that error entry with loc (). Python 3.12.10, Windows 11.
