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

Diacritics are not considered part of words #101421

Open
Labels
@xmo-odoo

Description

@xmo-odoo

I'm not sure whether it's a bug or expected behaviour, but it seems odd so I figure reporting it is a good idea: while a precomposed character is considered "a word" by the regex engine (specifically\w), its decomposed form is not, because a diacritic is not considered part of a word.

>>>importre,unicodedata>>>s="ö">>>list(s)['ö']>>>list(unicodedata.normalize('NFD',s))['o','̈']>>>re.fullmatch(r'\w+',s)<re.Matchobject;span=(0,1),match='ö'>>>>re.fullmatch(r'\w+',unicodedata.normalize('NFD',s))

This leads to odd effects when ingesting and filtering decomposed data.

Tested on 3.8.13, 3.10.6, and 3.11.1 (all installed via pyenv), on a Mint 21.1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp