[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-grep] Re: grep: -i option not working i cronjobs
From: |
Aharon Robbins |
Subject: |
Re: [bug-grep] Re: grep: -i option not working i cronjobs |
Date: |
Sun, 14 Nov 2004 09:24:23 +0200 |
> > 2) convert the regular expression to match both cases for any literals
> > simply by expanding each alphabetic symbol to a character class of it's
> > lowercase and upper case forms: e.g, 'a' -> '[aA]', 'B'-> '[bB]', etc.
> >
> > My guess is that for most cases, the second solution would be faster. But
> > that's just a semi-educated guess at the moment. Does anyone know better?
>
> I agree that (2) is the better solution. It better matches the intended
> meaning, and will work properly in situations like languages that have no
> lower-case equivalent of a certain character, or have more than one
> lower-case
> version of a single upper-case character.
Careful here. As I just recently learned, there are languages where
a lower case character is one byte and the upper case equivalent is a
multibyte character. (Or vice versa, I don't remember.) Thus, the
'a' -> '[aA]' solution is fine for ASCII, but doesn't generalize for other
character sets. Or least not simply.
Arnold
- Re: [bug-grep] Re: grep: -i option not working i cronjobs,
Aharon Robbins <=
Re: [bug-grep] Re: grep: -i option not working i cronjobs, Tim Waugh, 2004/11/15
Re: [bug-grep] Re: grep: -i option not working i cronjobs, Aharon Robbins, 2004/11/14