public inbox for glibc-bugs-regex@sourceware.org
help / color / mirror / Atom feed
From: "bonzini at gnu dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs-regex@sources.redhat.com
Subject: [Bug regex/11561] New: Collation characters represented by internal name instead of character sequence
Date: Fri, 30 Apr 2010 07:36:00 -0000	[thread overview]
Message-ID: <20100430073626.11561.bonzini@gnu.org> (raw)

In the glibc locale definitions, collating elements have a hyphenated name:

    collating-symbol  <zs>
    collating-element <z-s> from "<U007A><U0073>"

and the hyphenated name have to be used in regular expression for [[. .]] to
work properly:

    $ echo '*ch*' | LC_COLLATE=cs_CZ.UTF-8 sed 's/[[.c-h.]]//'
    **
    $ echo 'ch' | LC_COLLATE=cs_CZ.UTF-8 sed 's/[[.ch.]]//'
    sed: -e expression #1, char 12: Invalid collation character

However, POSIX 1.2008 says:

        A collating symbol is a collating element enclosed within
        bracket-period ( "[." and ".]" ) delimiters. Collating
        elements are defined as described in Collation Order .
        Conforming applications shall represent multi-character
        collating elements as collating symbols when it is
        necessary to distinguish them from a list of the
        individual characters that make up the multi-character
        collating element. For example, if the string "ch" is a
        collating element defined using the line:

        collating-element <ch-digraph> from "<c><h>"

        in the locale definition, the expression "[[.ch.]]" shall
        be treated as an RE containing the collating symbol 'ch',
        while "[ch]" shall be treated as an RE matching 'c' or
        'h' . Collating symbols are recognized only inside
        bracket expressions. If the string is not a collating
        element in the current locale, the expression is invalid.

POSIX especially mentions [[.ch.]] in the example instead of [[.ch-digraph.]] so
this is a bug in glibc.  It shouldn't be hard to fix it in regcomp.

-- 
           Summary: Collation characters represented by internal name
                    instead of character sequence
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: regex
        AssignedTo: bonzini at gnu dot org
        ReportedBy: bonzini at gnu dot org
                CC: glibc-bugs-regex at sources dot redhat dot com,glibc-
                    bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11561

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


                 reply	other threads:[~2010-04-30  7:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100430073626.11561.bonzini@gnu.org \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs-regex@sources.redhat.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).