What is the most efficient case-insensitive grep usage?
My objective is to match email addresses that belong to the Yahoo! family of domains. In *nix systems (I will be using Ubuntu), what are the benefits and drawbacks to any one of these methods for matching the pattern? And if there is another, more elegant solution that I haven't been capable of imagining, please share. Here they are: Use grep with option -i : grep -Ei "@(yahoo|(y|rocket)mail|geocities)\.com" Translate characters to all upper case or lower case then grep : tr [:upper:] [:lower:] < /path/to/file.txt | grep -E "@(yahoo|(y|rocket)mail|geocities)\.com" Include a character set for