def METHOD_NAME(target: str) -> str:
    """Returns the target string if it exists and is valid."""
    if not target:
        raise SyntaxError("target is required but not specified.")
    if not isinstance(target, str):
        raise SyntaxError("target is not str.")
    if not re.match("^[A-Za-z0-9._-]*$", target):
        raise SyntaxError("target must be a string of only valid characters and no spaces.")
    return target