import re


def get_ioc_value_from_ioc_name(ioc_obj):
    """
    Extract SHA-256 from string:
    ([file:name = 'blabla' OR file:name = 'blabla'] AND [file:hashes.'SHA-256' = '1111'])" -> 1111
    """
    ioc_value = ioc_obj.get('name')
    try:
        ioc_value = re.search("(?<='SHA-256' = ').*?(?=')", ioc_value).group(0)  # type:ignore # guardrails-disable-line
    except AttributeError:
        ioc_value = None
    return ioc_value