I think you can loose the parentheses, as you don’t need to capture the groups, and then your regex should be matching everything which starts with the single letter p as the first folder, and neither any files starting with _ within that folder.
The regexes could possibly be combined into one using lookaheads, but the readability goes out the window very fast then. I’m on mobile now, so can’t test that just now.
When I was working it out I was thinking of using look aheads but I read a thread (when I was trying to set up the queries for the tasks plugin) that it’s unpredictable or it might be slow so I figured I’d keep it simple(r)!
I’ve removed the brackets and done some more tweaking so now I have a colourful graph view too!