import re


def get_method(dataobject):

    """
    Returns the method string from
    the log of a Syncopy data object
    """

    # get the method string in a capture group
    pattern = re.compile(r'[\s\w\D]+method = (\w+)')
    match = pattern.match(dataobject._log)
    if match:
        meth_str = match.group(1)
        return meth_str