import re


def stat_check(string):
    """Validate input of filter string for values like atime, mtime, ctime.

    These shuld be integer values prefixed by a + or a - only with no spaces

    Eg:
        1
        5
        -10
        +20

    Invalid:
        1.5
        abc
        $#@
        + 5
        a5

    Return:
        String passed in

    Rasies ValueError if check doesn't pass
    """
    matched = re.match(r"^[+,-]?\d+$", string)
    if bool(matched):
        return string
    raise ValueError("Intagers only, optionally prefixed with + or -")