'Checks if the nfs path format is matched.
WebNFS url format with relative-path is supported.
Accepting all characters in path-names and checking
against the mounted shares which will contain only
allowed path segments. Returns connection and dir details.'

def _check_get_nfs_path_segs(self, image_location):

    (conn, dr) = (None, None)
    if image_location:
        nfs_loc_pattern = '^nfs://(([\\w\\-\\.]+:{1}[\\d]+|[\\w\\-\\.]+)(/[^\\/].*)*(/[^\\/\\\\\\\\]+)$)'
        matched = re.match(nfs_loc_pattern, image_location, flags=0)
        if (not matched):
            LOG.debug('Image    location    not    in    the    expected    format    %s', image_location)
        else:
            conn = matched.group(2)
            dr = (matched.group(3) or '/')
    return (conn, dr)
