[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [:ascii:] character class



On 2008-11-25 01:49 -0600, Boyd Stephen Smith Jr. wrote:
> On Monday 2008 November 24 10:54, Eugene V. Lyubimkin wrote:
> > Andre Majorel wrote:
> > > I seem to remember that the non-standard [:ascii:] character class
> > > was once supported. Now grep and sed give the error "Invalid
> > > character class name". Am I misremembering ? More importantly, is
> > > there a way to get it back ?
> > >
> > > Thanks in advance.
> >
> > "[[:ascii:]]" ?
> 
> Nope.  It's gone, and it probably won't be coming back.
> 
> You might be able to do something like '[\000-\377]' but I'm not
> sure exactly how all the escaping rules work for that off the
> top of my head.

The \-octal notation is not part of regular expressions (and it
would be 177, not 377).

Thanks for the idea, though, because you can enter the characters
directly, E.G., with bash, « grep '['$'\1'-$'\177'']' ». But you
can't get down to NUL that way. It would be prudent to force the C
locale, too.

Guess [:ascii:] was too convenient...

-- 
André Majorel <http://www.teaser.fr/~amajorel/>
No one ever sends you any email ? Report a bug in Debian !


Reply to: