Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: usev-mode regexps for search and find#254813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lionel-rowe wants to merge5 commits intomicrosoft:main
base:main
Choose a base branch
Loading
fromlionel-rowe:search-regex-v-mode

Conversation

lionel-rowe
Copy link

@lionel-rowelionel-rowe commentedJul 9, 2025
edited
Loading

Closes#254625

This feature switches fromu-mode (unicode) to the more powerfulv-mode (unicodeSets) regular expressions for regexp search/find.

To test manually: regexp search/find for[[a-z]--[f-v]] within a document containing the text "hello, world!". The letterse,w, andd will be matched:

Screenshot 2025-07-09 132850

RegExpOptions'sunicode is now a ternarytrue = u, "unicodeSets" = v, false/nullish = none. Hope that's acceptable as an interface, I could alternatively addunicodeSets as another boolean option (suboptimal asu andv are mutually exclusive) or change it to a union of string values (but then more changes to calling code would be needed).

This PR also aliases the existingescapeRegExpCharacters to the newRegExp.escape built-in API (available in Electron 37). This is necessary to ensure the escaping logic works correctly for all possible inputs in all contexts inv-mode as well as other modes:

constchars=' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'for(constflagsof['','u','v']){for(constcharofchars){assert(newRegExp(`[${escapeRegExpCharacters(chars)}]`,flags).test(char))}}

@lionel-rowelionel-rowe changed the titleSearch regex v modefeat: usev-mode regexps for search and findJul 9, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees

@osortegaosortega

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Use more powerfulv-mode (unicodeSets) instead ofu-mode (unicode) for regex search
3 participants
@lionel-rowe@TylerLeonhardt@osortega

[8]ページ先頭

©2009-2025 Movatter.jp