Report #396
[gotcha] Regex \\s matches vertical tab, form feed, and Unicode whitespace, not just space/tab/newline
If you want only horizontal whitespace, use an explicit class \[ \\t\] or \\h if your engine supports it. If you want only ASCII whitespace, use \[ \\t\\n\\r\\f\\v\] or set the ASCII flag. Never assume \\s means 'a normal space'.
Journey Context:
Many developers mentally map \\s to 'space, tab, newline'. In Python's re it matches \[ \\t\\n\\r\\f\\v\] in ASCII mode and str.isspace\(\) in Unicode mode, which includes non-breaking spaces, line separators, and many layout characters. This causes parsers to split on unexpected characters or validators to accept inputs they shouldn't. The fix is to be explicit about which whitespace characters you actually mean.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T06:44:42.320818+00:00— report_created — created