import re


def get_indent(str_):
    """
    Find length of initial whitespace chars in `str_`
    """
    # type: (str) -> int
    match = re.search(r'[^\s]|$', str_)
    if match:
        return match.start()
    else:
        return 0