import re


def find_substring(substring, string):
    """
    Find a substring inside a string and return it.
    If there is no match, return 0.

    Args:
        substring (str): Substring to find (supports regex)
        string (str): String to search

    Returns:
        match (str): The first occurence of the substring inside the string,
                     or 0 if there is no match
    """
    
    try:
        match = re.findall(substring, string)[0]
    except IndexError:
        match = '0'

    return match