Add min_prefix_len and pattern functions