A
A
Alexey Bespalov2022-02-08 04:11:01
Perl
Alexey Bespalov, 2022-02-08 04:11:01

How to get rid of "Wide character in regexp compilation at" in Russian regular expression?

Is it possible to get rid of curses on a regular expression with Russian letters?

Wide character in regexp compilation at F:/GIT/1c-translation-script/translate-with-dict.pl line 81.
Variable length lookbehind is experimental in regex; marked by <-- HERE in m/(?<=[^╨Р-╤П╤С╨Б]|^)╨Ь╨░╨║╤Б╨╕╨╝╤Г╨╝╨б╨╡╤А╨╕╨╣╨Ъ╨╛╨╗╨╕╤З╨╡╤Б╤В╨▓╨╛(?=[^╨Р-╤П╤С╨Б]|$) <-- HERE / at F:/GIT/1c-
translation-script/translate-with-dict.pl line 81.


$line =~ s/(?<=[^А-яёЁ]|^)$ru(?=[^А-яёЁ]|$)/$en/g;

Everything that can be already announced

#no warnings;
use utf8;
binmode STDOUT, ':utf8';
binmode STDIN, ':utf8';


I know about no warnings, but is it possible without it or not?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
vreitech, 2022-02-08
@fzfx

Try replacing
$line =~ s/(?<=[^А-яёЁ]|^)$ru(?=[^А-яёЁ]|$)/$en/g;
with

$line =~ s/(?<=[^А-яёЁ]|^)$ru(?=[^А-яёЁ]|$)/$en/gu;

P
pcdesign, 2022-02-08
@pcdesign

And if you take it all away

#no warnings;
use utf8;
binmode STDOUT, ':utf8';
binmode STDIN, ':utf8';

And write like this
use open ':std', ':encoding(UTF-8)';

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question