|
From: | Julian Foad |
Subject: | [bug-grep] Re: grep: -i option not working i cronjobs |
Date: | Fri, 12 Nov 2004 13:45:51 +0000 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113 |
Tony Abou-Assaleh wrote:
1) Have 2 buffers, original and TOLOWERCASE'ed, and when printing the output, print it from the original buffer 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.
- Julian
[Prev in Thread] | Current Thread | [Next in Thread] |