import re


def get_subroutine_begin_regex(name):
###############################################################################
    """
    >>> bool(get_subroutine_begin_regex("fake_sub").match("subroutine fake_sub("))
    True
    >>> bool(get_subroutine_begin_regex("fake_sub").match("subroutine fake_sub_2("))
    False
    >>> bool(get_subroutine_begin_regex("fake_sub").match("  subroutine  fake_sub ("))
    True
    >>> bool(get_subroutine_begin_regex("fake_sub").match("  subroutine  fake_sub ( one, two )"))
    True
    >>> bool(get_subroutine_begin_regex("fake_sub").match("! subroutine fake_sub("))
    False
    >>> bool(get_subroutine_begin_regex("fake_sub").match("subroutine fake_sub"))
    False
    """
    subroutine_begin_regex_str = r"^\s*subroutine\s+{}\s*[(]".format(name)
    return re.compile(subroutine_begin_regex_str)