import re


def get_unit_from_string(string):
    """Return [] encapsulated unit from string."""
    match = re.search('\[(.*)\]', string)
    ret = ''
    if match:
        ret = match.group(1)
    return ret