I'm trying to exclude all hidden directories from recursive search.
.*/\..* this should match hidden directories and this indeed works with find, however grep doesn't think so.
pcregrep -rnI -C 5 --exclude-dir='.*/\..*' '^\s*async def' .
grep -rnIP -C 5 --exclude-dir=*/.* '^\s*def' .
What am I doing wrong here?
Oh, and I know about ripgrep, silver searcher etc. The question is about grep and pcregrep.