I am trying the following regex to search txt files across multiple lines:
regex:content:puppy(.|\n)*?big
The test file is attached.
While typing the above text into the search bar, Everything 1.5a crashes.
After I type:
regex:content:puppy(.|\n)
it is fine.
As long as I type the "*", it crashes.
However, if I copy and paste the entire text into the search bar
regex:content:puppy(.|\n)*?big
It doesn't crash, and it finds this file.
Even if I modify the last part, say I change it to "bigge" or "bi", it still finds the file.
And if I change the last part to something that doesn't exist in the file, say "bigs", it doesn't find the file, as expected.
But if I delete the last characters up to "?", it crashes:
regex:content:puppy(.|\n)*
In Everything V1.4.1.969, it doesn't crash.
But, with
regex:content:puppy(.|\n)*?big
I can't find the file.
If I search within a line, then I can find the file:
regex:content:puppy.*shelter
Is this a bug in regex:content: searching?
Is this a bug in regex:content: searching?
- Attachments
-
- test.rar
- (742 Bytes) Downloaded 28 times
Re: Is this a bug in regex:content: searching?
Thank you for the bug report smarthu,
This is an issue with PCRE.
There's a recursive call to match which causes a stack overflow.
I'm looking into a fix..
For now, please try the following search:
dotall:regex:content:puppy.*
dotall:regex:content:puppy.*?big
regex:content:(?s)puppy.*
dotall:
The issue also applies to Everything 1.4 and earlier.
Please note you need to escape | in Everything 1.4 and earlier.
The following will crash Everything 1.4 and earlier:
regex:content:"puppy(.|\n)*"
Everything 1.5 will eat the |
It does not need to be escaped with double quotes (")
This is an issue with PCRE.
There's a recursive call to match which causes a stack overflow.
I'm looking into a fix..
For now, please try the following search:
dotall:regex:content:puppy.*
dotall:regex:content:puppy.*?big
regex:content:(?s)puppy.*
dotall:
The issue also applies to Everything 1.4 and earlier.
Please note you need to escape | in Everything 1.4 and earlier.
The following will crash Everything 1.4 and earlier:
regex:content:"puppy(.|\n)*"
Everything 1.5 will eat the |
It does not need to be escaped with double quotes (")
Re: Is this a bug in regex:content: searching?
Everything 1.5.0.1367a sets the regex recursion limit to 256.
The theoretical maximum on x64 is about ~512 and ~800 on x86.
This hard limit should prevent Everything from ever reaching these theoretical maximums and blowing up the stack. (crashing)
addcol:regmatch1 regex:content:puppy(.|\n)* should now silently fail instead of crashing.
Please use the following instead:
addcol:regmatch1 dotall:regex:content:puppy(.*)
The theoretical maximum on x64 is about ~512 and ~800 on x86.
This hard limit should prevent Everything from ever reaching these theoretical maximums and blowing up the stack. (crashing)
addcol:regmatch1 regex:content:puppy(.|\n)* should now silently fail instead of crashing.
Please use the following instead:
addcol:regmatch1 dotall:regex:content:puppy(.*)