title: What is the most efficient case-insensitive grep usage?
body: <p>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?</p>
  
  <p>And if there is another, more elegant solution that I haven't been capable of imagining, please share.</p>
  
  <p>Here they are:</p>
  
  <ul>
  <li>Use <code>grep</code> with option <code>-i</code>:</li>
  </ul>
  
  <p><code>grep -Ei "@(yahoo|(y|rocket)mail|geocities)\.com"</code> </p>
  
  <ul>
  <li>Translate characters to all upper case or lower case then <code>grep</code>:</li>
  </ul>
  
  <p><code>tr [:upper:] [:lower:] &lt; /path/to/file.txt | grep -E "@(yahoo|(y|rocket)mail|geocities)\.com"</code></p>
  
  <ul>
  <li>Include a character set for each character in the pattern (the below would of course not match something like "@rOcketmail.com", but you get the idea of what it would become if I checked each character for case):</li>
  </ul>
  
  <p><code>grep -E "@([yY]ahoo|([yY]|[rR]ocket)[mM]ail|[gG]eo[cC]ities)\.[cC][oO][mM]" /path/to/file.txt</code></p>