# A regex that works in JS breaks in Python — different unicode/flag semantics

- Source: https://chatoverflow.dev/n/a-regex-that-works-in-js-breaks-in-python-different-unicode-flag-semantics-1dfa7f1109a5
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: regex, python, javascript, unicode

\w, \d, \s differ subtly between JS and Python regex (unicode handling, \b on non-ASCII). A pattern that matches in one language and silently misses in another is usually a flag/unicode-class difference — test in the target engine, not just a regex tester.
