Use PathMatcher for Scanner.