Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.unix.shell > #4907

Re: grep is screwed on Debian, Ubuntu and others ...

From "Ed Morton" <mortonspam@gmail.com>
Newsgroups comp.unix.shell
Subject Re: grep is screwed on Debian, Ubuntu and others ...
Message-ID <201205042120552493@webuse.net> (permalink)
References <20120503180629.531@kylheku.com> <7QGor.22191$em4.6868@newsfe21.iad> <20120503211141.506@kylheku.com> <86r4uz3kzo.fsf@gray.siamics.net> <20120504103639.939@kylheku.com>
Date 2012-05-04 21:20 +0000

Show all headers | View raw


Kaz Kylheku <kaz@kylheku.com> wrote:

> On 2012-05-04, Ivan Shmakov <oneingray@gmail.com> wrote:
> >>>>>> Kaz Kylheku <kaz@kylheku.com> writes:
> >>>>>> On 2012-05-04, Lew Pitcher <lpitcher@teksavvy.com> wrote:
> >
> > 	[Cross-posting to news:comp.text, for the subject being
> > 	discussed is hardly specific to Unix shells.]
> >
> > [...]
> >
> > >> Consequently, the alternate form of '[A-B]' is not '[:upper:]', but
> > >> instead is '[[:upper:]]'.  That is, the '[:upper:]' is enclosed
> > >> within a set of square brackets, just like 'A-B' is.
> >
> > > You must be the real Lew Pitcher because you have a clue. :)
> >
> > > In my defense, I've never used this committee-designed dog of a
> > > syntax until today, which was only because I was groping for a quick
> > > workaround, and likely never will again.
> >
> > > (I also refuse to implement it in my regex engine, though I have
> > > caved in to Perl's \w, \d, \s, \W, \D and \S, which is probably as
> > > far as I will go.)
> >
> > 	How do you specify a "single character, either an upper-case
> > 	letter or a digit" within such a regular expression, then?
> 
> [A-Z0-9]
> [A-Z\d]

In all other tools that match on character ranges, the above character ranges
only mean "single character, either an upper-case letter or a digit" in some
locales. In other locales they mean various different things (google...).

This:

   [[:upper:][:digit:]]

means "single character, either an upper-case letter or a digit" in all locales
in all tools that implement character classes.

    Ed.

Posted using www.webuse.net 

Back to comp.unix.shell | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 01:25 +0000
  Re: grep is screwed on Debian, Ubuntu and others ... Lew Pitcher <lpitcher@teksavvy.com> - 2012-05-03 22:05 -0400
    Re: grep is screwed on Debian, Ubuntu and others ... Ed Morton <mortonspam@gmail.com> - 2012-05-03 21:32 -0500
      Re: grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 04:51 +0000
        Re: grep is screwed on Debian, Ubuntu and others ... Janis Papanagnou <janis_papanagnou@hotmail.com> - 2012-05-04 07:37 +0200
        Re: grep is screwed on Debian, Ubuntu and others ... Ed Morton <mortonspam@gmail.com> - 2012-05-04 08:33 -0500
    Re: grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 04:44 +0000
      Re: grep is screwed on Debian, Ubuntu and others ... Ed Morton <mortonspam@gmail.com> - 2012-05-04 08:47 -0500
      Re: grep is screwed on Debian, Ubuntu and others ... Ivan Shmakov <oneingray@gmail.com> - 2012-05-05 00:38 +0700
        Re: grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 17:45 +0000
          Re: grep is screwed on Debian, Ubuntu and others ... "Ed Morton" <mortonspam@gmail.com> - 2012-05-04 21:20 +0000
          character classes & regular expressions Ivan Shmakov <oneingray@gmail.com> - 2012-05-05 09:35 +0700
            Re: character classes & regular expressions Kaz Kylheku <kaz@kylheku.com> - 2012-05-05 02:42 +0000
              Re: character classes & regular expressions Ivan Shmakov <oneingray@gmail.com> - 2012-05-05 10:00 +0700
            Re: character classes & regular expressions Cydrome Leader <presence@MUNGEpanix.com> - 2012-05-06 02:31 +0000
              Re: character classes & regular expressions Ivan Shmakov <oneingray@gmail.com> - 2012-05-06 12:15 +0700
                Re: character classes & regular expressions Cydrome Leader <presence@MUNGEpanix.com> - 2012-05-06 07:47 +0000
                copyright in Russia Ivan Shmakov <oneingray@gmail.com> - 2012-05-10 19:28 +0700
      Re: grep is screwed on Debian, Ubuntu and others ... Lew Pitcher <lpitcher@teksavvy.com> - 2012-05-04 14:31 -0400
    Re: grep is screwed on Debian, Ubuntu and others ... Richard Kettlewell <rjk@greenend.org.uk> - 2012-05-04 09:12 +0100
    Re: grep is screwed on Debian, Ubuntu and others ... James Waldby <not@valid.invalid> - 2012-05-05 18:25 +0000
  Re: grep is screwed on Debian, Ubuntu and others ... Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> - 2012-05-04 12:56 +0200
    Re: grep is screwed on Debian, Ubuntu and others ... Kaz Kylheku <kaz@kylheku.com> - 2012-05-04 17:47 +0000

csiph-web