<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def getdim(lsp):
    '''
    Obtain the dimensionality of a .lsp file. This should work for all well
    formatted .lsp files.

    Parameters:
    -----------
       lsp      : .lsp string

    Returns a list of dimensions.
    '''
    dims= ['x','y', 'z'];
    rxs = ['{}-cells *([0-9]+)'.format(x) for x in ['x','y','z']];
    return [
        x for x,rx in zip(dims,rxs)
        if re.search(rx,lsp) and int(re.search(rx,lsp).group(1)) > 0 ];