It's my first post here, it's great place and it helps me a lot !
So I'm using pcregrep and I want to catch files with my pattens. I'm using variable for regex like:
test="<\?php\n.*. = Array\(('.'=>'.', ){20,}.*\);\nfunction .*\(.*, .*\).*for\(.i=0; .i .*\nreturn base64_decode(.*);}\n.* ('.*'.\n){10,}.*"
and then searching for files:
find . -type f -name "*.php1" -print0 | xargs -0 pcregrep --colour=auto -M "$test"
You can find test.sh (bash file that I'm using) and *.php1 file that I want to match here: http://sendrev.com/stackoverflow/
When I run sh test.sh it always find rows to (I saw it in colour because I'm using --colour=auto
):
'yzr3YEca5VacRthC6tGoXNkS2n8S2n8S2n8S2n8S2n8S4wUSFBc9FhGcqtcP6JTk4J0kj5TOMZ0yYmL'.
(or other, but not shows end of file)
I can't match more lines from that and I can not understand why. I want to match last line with something like:
"eval\(.*(.*, .*\)\);\?>$"
or
"\)\);\?>"
but I can't goes to that line. If I add "));\?>" to end of "test" variable there's nothing found, because it can't goes to last line.
!!! Importnat is that if lines with '.*'.
are much less than everything is okay. It looks there is some limitation that I can't understand.
You can test it if you have CentOS or other linux distribution.
Can you please help searching mistakes from my side ? Thanks.