From: "Ruslan N. Balkin" <baron@dartel.ru>
To: community@altlinux.ru
Subject: Re: [Comm] [JT] а работает ли мастеровский перл, регулярные выражения, с русскими буквами?
Date: Sat, 26 Oct 2002 02:00:32 +0400
Message-ID: <20021026020032.275b37e9.baron@dartel.ru> (raw)
In-Reply-To: <20021026010809.7acbaada.maga@replay.ru>
[-- Attachment #1: Type: text/plain, Size: 1812 bytes --]
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, как и положено, или задавайте ранг
так: [абвгдежзийкл] :)
--
С уважением,
Балькин Руслан.
[-- Attachment #2: For security, this message has been digitally signed. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2002-10-25 22:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-10-23 15:27 Maxim
2002-10-23 15:37 ` Sergey Degtyaryov
2002-10-23 16:36 ` [Comm] Re[2]: " Maxim
2002-10-24 5:20 ` Andrei M. Laptev
2002-10-24 11:11 ` Ruslan N. Balkin
2002-10-25 4:50 ` Andrei M. Laptev
2002-10-25 11:16 ` Ruslan N. Balkin
2002-10-25 18:42 ` Karpov A.
2002-10-25 21:08 ` Sergey V. Degtyaryov
2002-10-25 22:00 ` Ruslan N. Balkin [this message]
2002-10-25 22:25 ` Sergey V. Degtyaryov
2002-10-26 1:50 ` Ruslan N. Balkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021026020032.275b37e9.baron@dartel.ru \
--to=baron@dartel.ru \
--cc=community@altlinux.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git