notepad-plus-plus / notepad-plus-plus/notepad-plus-plus

Regular expression switches don't recognize non-latin text

Open
#2,796 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
29.4k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Npp regex switched don't work on non-latin texts it.

Description of the Issue

I'm trying to change character case in some cyrillic texts using Find&Replace and regular expressions. Unfortunatelly Npp understands \L\l\U\u switches only on latin characters. All other unicode characters are ignored, and there is not way to tell Npp how to handle them properly.

Steps to Reproduce the Issue
  1. Type some non-latin text in upper-case (i.e. ФЫВА ОЛДЖ)
  2. Open Replace dialog (Ctrl+H)
  3. Find what: (\w+)
  4. Replace with: \L$1
  5. Select "Regular expressions" option.
  6. Click "Replace All"
Expected Behavior

Text to be replaced with lower-case version (i.e. фыва олдж)

Actual Behavior

Text remains upper-case (i.e. ФЫВА ОЛДЖ)

Debug Information

Notepad++ v7.3 (32-bit)
Build time : Jan 1 2017 - 20:04:42
Path : C:\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : ON
OS : Windows 10
Plugins : mimeTools.dll NppConverter.dll NppExport.dll NppSharp.dll PluginManager.dll

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue through the Find & Replace dialog using the listed Cyrillic text, regular-expression mode, and the replacement \L$1. Trace the regular-expression replacement handling and verify that Replace All converts non-Latin Unicode characters to lowercase while preserving the existing Latin behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.