import re


def _parse(val: str):
    """Parse string expression containg value and unit

    Arguments:
       val: String expression

    Returns:
       `Tuple` containing value and unit
    """

    if not isinstance(val, str):
        raise TypeError("Method requires string input")

    value = re.findall(r'^([-+]?\d*\.\d*(?=\s)|\d+(?=\s))', val)
    if not (value and val[:len(value[0])] == value[0]):
        return val, None

    # string starts with value
    value = value[0]
    val = val[len(value):]

    val = val.strip()
    if val:
        unit = val
    else:
        unit = 'dimensionless'

    return value, unit