Added support for path length in pattern()