coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

`expr` failed to match multibyte character

Open Luv-Ray opened this issue 6 months ago • 2 comments

regex engine should match the . to the multibyte characters.

> expr match 你好a ..a
3
> ./target/debug/coreutils expr match 你好a ..a
7

Luv-Ray avatar Jul 12 '25 12:07 Luv-Ray

we are using onig (a wrapper around the Oniguruma regular expression library) to deal with regex, however, oniguruma will never support locale.

Luv-Ray avatar Jul 13 '25 08:07 Luv-Ray

Yes, this is why we can't completely pass the expr-multibyte.pl GNU test.

At some point if we want locale support for regexes, we will have to switch from oniguruma.

c.f. https://github.com/uutils/coreutils/pull/8292#discussion_r2192901229

RenjiSann avatar Jul 15 '25 22:07 RenjiSann

Fixed by #8606

RenjiSann avatar Oct 11 '25 22:10 RenjiSann