Operating System - Tru64 Unix
1748140 Members
3556 Online
108758 Solutions
New Discussion

grep regular expression problem slow performance

 
Jim Wagner_2
Occasional Contributor

grep regular expression problem slow performance

Running OSF1 5.1 732

Trying to match a double-quoted string using (extended) regular expressions. The string may contain escaped quotes (\") or other escaped characters.
The ERE I'm using is

grep -E '"([^\\\"]+|\\\\.)*"'

This matches short strings like
"abc"
but performance degrades quickly with longer strings:
"abc abc mmmmm mmmm mmm"
does not terminate within a couple of minutes.

The problem exhibits itself both in 'grep' and using 'regexec()' in a C program.

The ERE works fine on Solaris and HPUX.
Does anyone know of a workaround which avoids this problem, or know if it is fixed in a patch?
Thanks in advance.
1 REPLY 1
Ravi_8
Honored Contributor

Re: grep regular expression problem slow performance

Hi

I had this problem in 5.0 after applying patchkits it solved the problem
never give up