title: Does grep work differently on OSX
body: <p>I am trying to use grep like I am used to from Linux, with all its amazing features and all the power from RegEx,... but on Mac OS X  it's not working as I expect.</p>
  
  <p>If I use "-P" (Perl Regex) it gives me the "usage" (--help) output.
  In there we find the "-P" parameter in the list of parameters "-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ"...
  Still not working.</p>
  
  <p>Another example is the asterisk or the plus sign.
  I am trying this <a href="http://wiki.bash-hackers.org/howto/conffile">http://wiki.bash-hackers.org/howto/conffile</a></p>
  
  <p>To check a config file for inappropriate content that instruction uses:</p>
  
  <pre><code>if egrep -q -v '^#|^[^ ]*=[^;]*' "$configfile"; then
    echo "Config file is unclean, cleaning it..." &gt;&amp;2
    # filter the original to a new file
    egrep '^#|^[^ ]*=[^;&amp;]*'  "$configfile" &gt; "$configfile_secured"
    configfile="$configfile_secured"
  fi
  </code></pre>
  
  <p>And it does not work on lines like this:</p>
  
  <pre><code>DATABASE=some_database; ls -la
  </code></pre>
  
  <p>What am I doing wrong?
  Cause all of this works just fine on Linux machines.</p>