If I have ...
egrep -i "[[:space:]]bird" somefile.txt
the processing time is relatively quick.
However, once I introduce a "choice" in my regexp, the processing time is very slow ...
egrep -i "(^|[[:space:]])bird" somefile.txt
it works as expected, but very slow, epsecially for large files!
Using "sed" and/or "awk" to achieve nearly the same result works a lot faster, BUT neither one can handle case sensitivity!!
Is there a trick to speeding-up this form of egrep?
[note: I'm on Solaris 9 using ksh shell)
egrep -i "[[:space:]]bird" somefile.txt
the processing time is relatively quick.
However, once I introduce a "choice" in my regexp, the processing time is very slow ...
egrep -i "(^|[[:space:]])bird" somefile.txt
it works as expected, but very slow, epsecially for large files!
Using "sed" and/or "awk" to achieve nearly the same result works a lot faster, BUT neither one can handle case sensitivity!!
Is there a trick to speeding-up this form of egrep?
[note: I'm on Solaris 9 using ksh shell)