import fnmatch


def list_match(zkclient, path, pattern, watcher=None):
    """Get a list of nodes matching pattern."""
    children = zkclient.get_children(path, watch=watcher)

    return [node for node in children if fnmatch.fnmatch(node, pattern)]