
    Write a function to verify if a user's social media handle begins and ends with the same character, as this pattern helps in identifying and recommending profiles with memorable username patterns to potential connections. The function should return true if the first and last characters of the handle match, and false otherwise.
    

    
import re
regex = '^[a-z]$|^([a-z]).*\\1$'

def check_char(string):
    """
    Write a function to verify if a user's social media handle begins and ends with the same character, as this pattern helps in identifying and recommending profiles with memorable username patterns to potential connections. The function should return true if the first and last characters of the handle match, and false otherwise.
    

    """
import re
regex = '^[a-z]$|^([a-z]).*\\1$'

def check_char(string):
    """
    Write a function to verify if a user's social media handle begins and ends with the same character, as this pattern helps in identifying and recommending profiles with memorable username patterns to potential connections. The function should return true if the first and last characters of the handle match, and false otherwise.
    

    """
    if re.search(regex, string):
        return 'Valid'
    else:
        return 'Invalid'