Skip to content

Using \w in Find dialog doesn't find non-English Unicode characters #209811

Description

@ermshiperete

Does this issue occur when all extensions are disabled?: Yes

Version: 1.88.0
Commit: 5c3e652
Date: 2024-04-03T13:25:57.039Z
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Linux x64 6.5.0-26-generic

Steps to Reproduce:

  1. Create a document containing the word Käse
  2. Open Find dialog, check "Use regular expressions" and enter \w in the Find field

Expected behavior:

  • All four characters are selected

Actual behavior:

  • ä is not selected

It is possible that this behavior is by design. In that case the problem is the lack of documentation of the Regex syntax that vscode uses, at least this page doesn't have any details.

Searching on Microsoft's websites reveals this page which suggests that \w should include all lower- and uppercase letters.

I guess the problem is that vscode uses the ECMAScript flavor. So a workaround would be to use [\p{Ll}\p{Lu}\p{Lt}\p{Lo}\p{Nd}\p{Pc}\p{Lm}] to match all upper- and lowercase letters instead of \w.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bugeditor-findEditor find operations

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions