import re

def check_char(string):
    if not string:
        return False
    return bool(re.match(r'^(.).*\1$|^.$', string))