Skip to content

Smart-case regex matching#5323

Open
d3m3t3r wants to merge 2 commits intomawww:masterfrom
d3m3t3r:smartcase-matching
Open

Smart-case regex matching#5323
d3m3t3r wants to merge 2 commits intomawww:masterfrom
d3m3t3r:smartcase-matching

Conversation

@d3m3t3r
Copy link
Copy Markdown

@d3m3t3r d3m3t3r commented Apr 28, 2025

Adds new regex modifier (?c) to enable smart-case matching.

In this mode, case-insensitive matching is used unless there is an uppercase character present in the pattern; otherwise case-insensitive matching applies (e.g. A, [A-Z], \QA\E, \x41 count as an uppercase).

Fixes #4856 and #5320.

#  Use incremental smart-case search by default.
:map global normal '/' '/(?c)'

d3m3t3r added 2 commits April 28, 2025 19:48
Additionally, as a prerequisite for smart-case matching, ranges in
the parsed chatacter class are now built to be independent of
the current case-sensitivity modifiers.
Add new regex modifier `(?c)` that enables smart-case matching.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[REQUEST] Smart case regex modifier

1 participant