[Comm] [JT] а работает ли мастеровский перл, регулярные выражения, с русскими буквами?

Ruslan N. Balkin =?iso-8859-1?q?baron_=CE=C1_dartel=2Eru?=
Сб Окт 26 02:00:32 MSD 2002


On Sat, 26 Oct 2002 01:08:09 +0400
Sergey wrote:

> Доброго дня, Karpov. 
> 25 Октября в 22:42 Вы сказали буквально следующее:
> 
> > >>KOI8 однако, видимо проблема в том, что не подряд идут.
> > >>
> > >Дык я всегда счтал что грамотно настроенная локаль и должна
> > >решать в том числе и проблемы KOI8, с буковками расположенными
> > >не подряд. Весь вопрос как это сказать перлу, чтоб при
> > >сортировке учитывал установки локали.
> 
> Да, я сразу не подтвердил, сорри.
> [а-я] не соответствует действительности.
> Проверил на 3-х ALT.
> use locale вовсе не use. А если и use, но не locale.
Уверен, с KOI8 работать не будет. Непоследовательно идут буквы.
С perldoc.com, faq по regex:
How can I match a locale-smart version of /[a-zA-Z]/?  toc

One alphabetic character would be /[^\W\d_]/, no matter what locale you're
in. Non-alphabetics would be /[\W\d_]/ (assuming you don't consider an
underscore a letter).

И еще в подтверждение моей правоты - из man regex:       
A bracket expression is a list of characters enclosed in `[]'.  It nor-    
mally matches  any single character from the list (but see below).  If   
the list begins with `^', it matches  any  single  character  (but  see 
below)  not  from  the rest of the list.  If two characters in the list
are separated by `-', this is shorthand for the full range  of charac-     
ters  between  those  two  (inclusive)  in the collating sequence, e.g.    
`[0-9]' in ASCII matches any decimal digit.  It is illegal(!)  for two    
ranges  to share an endpoint, e.g. `a-c-e'. Ranges are very collating-   
sequence-dependent, and portable programs should avoid relying on them.

То есть пользуйтесь use locale; и \w, как и положено, или задавайте ранг
так: [абвгдежзийкл] :)
-- 
С уважением,
Балькин Руслан.
----------- следующая часть -----------
Было удалено вложение не в текстовом формате...
Имя     : signature.txt
Тип     : application/pgp-signature
Размер  : 189 байтов
Описание: For security, this message has been digitally signed.
Url     : <http://lists.altlinux.org/pipermail/community/attachments/20021026/a78f482d/attachment-0002.bin>


Подробная информация о списке рассылки community