Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

regexp too big ! error ! 1

Status
Not open for further replies.

Graziella

Programmer
Jul 8, 2004
38
AT
I get this error message

/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/: regexp too big at ...

But I do not have a regex with a seried of \\\\\\ at all !

Any ideas ?

Thank you,

Grazia
 
I am able to give more info.
The pattern I am trying to match is this
$pattern = "(neurological|brain|seizure|paroxysmal|underlying|mental|nervous"
for which I have used quotemeta to escape all these characters.
I have noticed that between each pair of words separated by |, once I used quotemeta, Perl puts a very long series of \\\\\\\\. Like in this example:

\\\\\\\\\\\\\\\\|mental\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\|nervous
It seems rather odd.
Any idea ?

Grazia

 
There is no reason it should do that, just like the other problems you have posted, there is no reason. There must be a problem in your script elsewhere causing this. Using quotemeta once on a string will not do that. Its like you are using quotemeta over and over again on the same string.
 
I solved the problem:
The regex became large because in my code I had

foreach $item (@array) {
#.....
#......
if (certain condition){
quotemeta ($item);
}
#........
}

So, it ended up being "quotemeta"-ed in a loop and I had to undef it at a certain point.

Grazia
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top