this works under lion:
echo 1 | grep " \\( \(byhhfyghes\|TB\)/[0-9]\+\(\.[0-9]\+\)\? \(bytes\|KB\|MB\|GB\|TB\) ([0-9]\+/[0-9]\+ bytes)\\|[0-9]\+/[0-9]\+ bytes\\) of \"\\([^\"]*\"\\)\\+ to [^/]*/[^/]*/[1-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}$"
but this does not:
echo 1 | grep " \\( \(byhhgfyghes\|TB\)/[0-9]\+\(\.[0-9]\+\)\? \(bytes\|KB\|MB\|GB\|TB\) ([0-9]\+/[0-9]\+ bytes)\\|[0-9]\+/[0-9]\+ bytes\\) of \"\\([^\"]*\"\\)\\+ to [^/]*/[^/]*/[1-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}$"
error message: grep: Regular expression too big
It works on all prior versions of OS X that I have tested. I've googled around and lion is breaking things in numerous place due to this grep error message coming up.
It's not a character length limit, formula complexity is also a factor. And this isn't even
close to the complexity that some of my expressions get.
The biggest monster in that log analyzer, that runs fine on anything before lion, is this:
"^[A-Z][a-z]\{2\} \([ 12][0-9]\|3[01]\) \([0-1][0-9]\|2[0-3]\):[0-5][0-9]:[0-5][0-9] wired\[[1-9][0-9]*\]: Info: Received \\([0-9]\+\(\.[0-9]\+\)\? \(bytes\|KB\|MB\|GB\|TB\)/[0-9]\+\(\.[0-9]\+\)\? \(bytes\|KB\|MB\|GB\|TB\) ([0-9]\+/[0-9]\+ bytes)\\|[0-9]\+/[0-9]\+ bytes\\) of \"\\([^\"]*\"\\)\\+ from [^/]*/[^/]*/[1-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}$"
Since lion appears to be using the same build of grep as tiger,
grep --version
grep (GNU grep) 2.5.1
grep --version
grep (GNU grep) 2.5.1
So I checked filesizes:
10.4.11 ppc:
stat /usr/bin/grep
234881032 11389086 -rwxr-xr-x 3 root wheel 0 200064 "Nov 26 15:20:29 2011" "Jul 1 18:24:41 2006" "Feb 21 12:35:12 2008" 4096 392 0 /usr/bin/grep
10.6.8 intel:
stat /usr/bin/grep
234881027 37859256 -rwxr-xr-x 1 root wheel 0 227488 "Nov 26 15:21:53 2011" "Feb 10 23:54:37 2010" "May 20 08:39:39 2010" "Feb 10 23:54:37 2010" 4096 208 0x20 /usr/bin/grep
10.7.2:
stat /usr/bin/grep
234881032 67657 -rwxr-xr-x 3 root wheel 0 232064 "Nov 26 16:21:03 2011" "Oct 10 00:06:04 2011" "Oct 10 00:06:04 2011" "Jun 24 23:03:33 2011" 4096 224 0x20 /usr/bin/grep
So --version appears to not tell the whole story. I scp'd a copy of 10.6.8's grep to a lion machine, and imagine that, it works fine.
xserve:/library/wired admin $ grep --version ; echo 1 | grep " \\( \(byhhgfyghes\|TB\)/[0-9]\+\(\.[0-9]\+\)\? \(bytes\|KB\|MB\|GB\|TB\) ([0-9]\+/[0-9]\+ bytes)\\|[0-9]\+/[0-9]\+ bytes\\) of \"\\([^\"]*\"\\)\\+ to [^/]*/[^/]*/[1-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}$"
grep (GNU grep) 2.5.1
Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
grep: Regular expression too big
xserve:/library/wired admin $ ./grep --version ; echo 1 | ./grep " \\( \(byhhgfyghes\|TB\)/[0-9]\+\(\.[0-9]\+\)\? \(bytes\|KB\|MB\|GB\|TB\) ([0-9]\+/[0-9]\+ bytes)\\|[0-9]\+/[0-9]\+ bytes\\) of \"\\([^\"]*\"\\)\\+ to [^/]*/[^/]*/[1-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}\.[0-9][0-9]\{0,2\}$"
grep (GNU grep) 2.5.1
Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
xserve:/library/wired admin $
hrmf. Is someone at apple playing with grep?