Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DeepSearch lowercases a regular expression before using it for a case-insensitive search. That changes the meaning of escapes: searching for
\S+(non-whitespace) instead searches for\s+(whitespace), and\D+becomes a digit search.Use
re.IGNORECASEinstead, keeping both the pattern and the searched text intact. This also preserves Unicode escapes and lets groups such as(?-i:ABC)keep their explicitly case-sensitive behavior. Literal searches and the flags of precompiled patterns retain their existing behavior. This addresses the problem also described in the closed PR #631.The search tests pass all 78 cases, including regressions for escaped characters, dictionary paths, scoped flags, and compiled patterns. Pyright reports no errors for the changed module. On Windows with Python 3.12, the broader run passes 1,319 tests with 8 skips and one failure in
test_delta_dump_and_read3; that same text-mode pickle failure occurs on unchangeddev. The security test module and two restricted-pickle tests were excluded from this local run. Other operating systems and Python versions have not been tested locally.