| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…OCALE _fuse_difference() rewrites <flat charset A> (?<![B]) into the single charset [NEGATE] B [NEGATE] A. That is sound where the engine walks a set once, but SRE(charset_loc_ignore) walks it twice, once with the lowercased character and once with the uppercased one, and matches if either walk does. The second walk starts with the NEGATE polarity reset, so a character that matches B in one case and A in the other escapes the subtraction. The pass did not see the compile flags, so it could not tell the two apart. Thread the effective flags through optimize() and _walk(), combining them for a scoped group, and skip the fusion when IGNORECASE and LOCALE are both set, the condition _compiler.py already uses to emit IN_LOC_IGNORE.
| Back | FazBrowse Home | New Git URL |
_fuse_difference() now sees the compile flags and skips the fusion when IGNORECASE and LOCALE are both set, which is exactly when the fused set would compile to IN_LOC_IGNORE. The flags are threaded through optimize() and _walk() and recombined for a scoped group, so (?i:...) inside a re.LOCALE pattern is covered too.
No NEWS fragment: the fusion landed earlier in this cycle (GH-152214) and has never been in a release, so there is nothing a user could have hit.