add script to match paths to patterns