To find the classes having a private constructor I would like to use
git grep -lzP 'class\s+(\w++)[\s\S]*private\s+\1'
But it finds no result, however with the find command it finds
find */src/main/java -type f -exec grep -lzP 'class\s+(\w++)[\s\S]*private\s+\1' {} +